[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: paths starting with "//" are invariant?

Subject: Re: paths starting with "//" are invariant?
From: Ray Waldin <rwaldin@xxxxxxxxxxx>
Date: Sun, 19 Dec 1999 22:35:41 -0800
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.