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

Re: AW: AW: Using key() from outside the default names

Subject: Re: AW: AW: Using key() from outside the default namespace
From: Peter Flynn <peter@xxxxxxxxxxx>
Date: 12 Aug 2003 23:29:15 +0100
words with all aw
On Fri, 2003-08-08 at 16:48, Markus Abt wrote:

> Honest, the "trigger problem" is not here, but in (2) below.
> 
> >> (2) In your format template, you use this variable (via the param of
> >> the same name):
> >>         <xsl:apply-templates select="$content"/>
> >
> >Right, because $content may contain further subelements which need
> >matching in templates.
> 
> No, it does only contain one root node and one text node, since the
> value-of doesn't return the whole tree but only the first text node.

Duh. I should have seen that coming. I'd forgotten I *wasn't* retrieving
the key value via the select attribute of xsl-variable. Grrr. Thanks.

> If you use copy-of instead of value-of, then the variable $content will
> contain a result tree fragment with all subelements.
[...]
> Then, you can either
> -  use <xsl:copy-of select="$content"/> here to copy the result
>    tree fragment to the output *without processing*, or

No, I do need to apply templates to the subelement content...

> -  use <xsl:apply-templates select="xx:node-set($content)/node()"/>
>    to first convert the result tree fragment to a node set, and then
>    apply templates to the resulting node-set.
>    Note the .../node() here, to avoid "firing" of the root template...

...but oddly, if I use copy-of, it appears to treat the result tree 
fragment as a node set without the need for exsl:node-set, because it 
ends up applying templates to the subelement content rather than 
passing it unchanged as I would have expected with copy-of. In other
words, subelements in $content do get transformed correctly. Strange.

> >It looks as if it simply isn't possible in XSLT transparently to
> >revisit a document like this to retrieve a key value. 
> 
> No, it is, via a node-set() extension function.

Unfortunately the downloads from http://www.exslt.org/download.html
don't actually contain the required file, exsl.node-set.xsl (it's
not in either exsl.zip nor all-exslt.zip

Does anyone know where it is available from?

///Peter



 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.