|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: paths starting with "//" are invariant?
"Mark D. Anderson" wrote:
> i've got a sizable template in which this:
> <xsl:value-of select="//core:type[@id='publisher_type']/@id"/>
>
> works correctly when in my main template, but finds no nodes when in
> a later template.
>
> with my understanding, any path starting with "//" should produce
> the same thing regardless of where it is located, at least as long
> as it doesn't use any variables in it, and there is no use of xsl:document
> above it.
I'm only guessing here, but could it be that the namespace prefix core: maps to
different namespaces uris at these two points? That's somewhat variable, isn't
it?
For example:
<xsl:template match="main" xmlns:core="something">
<xsl:value-of select="//core:type[@id='publisher_type']/@id"/>
</xsl:template>
vs...
<xsl:template match="later" xmlns:core="something-else">
<xsl:value-of select="//core:type[@id='publisher_type']/@id"/>
</xsl:template>
or worse...
<xsl:template match="worse">
<xsl:value-of select="//core:type[@id='publisher_type']/@id"/>
</xsl:template>
I know it's a stretch, but these three templates return different results for
the same document.
-Ray
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








