[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Using absolute path when context item is an atomic value xslt 2.0


Subject: Re: [xsl] Using absolute path when context item is an atomic value xslt 2.0
From: Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx>
Date: 18 Oct 2005 18:21:49 +0100

>>>>> "Andrew" == andrew welch <andrew.j.welch@xxxxxxxxx> writes:

    Andrew> If it did what it usually does when context is an actual
    Andrew> node (even if its from a rootless tree)

I think you missed my point - it is perfectly possible for there to be NO
document trees whatsoever - this occurs in quite a few of the FXSL for
XSLT 2.0 tests.
This situation occurs when you invoke a tranformation with an initial
template, and don't supply a context document (actually, Saxon 8
doesn't ALLOW you to supply a context document from the command line
when you supply an initial template - gestalt does though).

    Andrew> when the context is an atomic value its an error to try and select any
    Andrew> nodes at all, which is strange because you would expect
    Andrew> the two could co-exist happily.

It's not  error to try to select a node when the context
item is an atomic node - it's just an error to refer to the context
node. The two can happily co-exist.

    Andrew> As I say, I haven't spent much time processing atomic
    Andrew> values yet so my expectations might be off, but I think
    Andrew> it's intuitive that:

    Andrew> <xsl:template match="node"> <xsl:for-each select="1 to
    Andrew> 10"> <xsl:apply-templates/>

OK - I can see it would appear intuitive (to me it does not, but then
I've been working with atomic values non-stop for nearly 2 years now,
so I'm rather used to it).

    Andrew> The concept of the context "node" being an atomic value
    Andrew> adds quite a bit to the learning curve...

Well, it would if there were such a concept. 
You have to get used to thinking of the context item. Not really
something that needs learning, just a habit that has to be formed.

I'm fortunate - I've forgotten most of my XSLT 1.0 programming, so I
don't have to unlearn it anymore :-)
-- 
Colin Adams
Preston Lancashire


Current Thread
Keywords