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

Re: Using absolute path when context item is an atomic

Subject: Re: 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
atomic node
>>>>> "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

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.