Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XSLT namespace selection (how)?

From: Bjoern Hoehrmann <bjoern@---------.-->
To: NULL
Date: 6/5/2007 11:28:00 PM

* xailor wrote in comp.text.xml:
>On Jun 5, 1:43 pm, Joseph Kesselman <keshlam-nos...@comcast.net>
>wrote:
>>         select="opensearch:totalResults"
>>         select="feed:feed/feed:entry/opensearch:totalResults"
>
>I just tried this from that XML example in the XSL below but I receive
>no selection of the data?  Shouldn't the whole openSearch prefix be
>prefixed itself?  Thanks for all the newbie help.
>
><?xml version='1.0'?>
><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>        xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'
>        xmlns:gm='http://base.google.com/ns-metadata/1.0'
>        xmlns:g='http://base.google.com/ns/1.0'
>        xmlns:batch='http://schemas.google.com/gdata/batch'
>        xmlns:feed='http://www.w3.org/2005/Atom'
>        version="1.0"
>>
><xsl:template match="/">
><div>
>        <span>total1=<xsl:value-of select="openSearch:totalResults"/>

Again, here the context node is the document node which usually has a
single child node, the root element of the document, the <feed> element
in your example. 'openSearch:totalResults' matches all openSearch:
totalResults elements that are a child of the context node, but there
is no such child.

>        <span>total2= <xsl:value-of select="feed:feed/feed:entry/
>openSearch:totalResults"/> </span>

This would only match the first openSearch:totalResults element, you
likely want this for each entry.
-- 
Björn Höhrmann · mailto:bjoern@h... · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent