Subject: Re: [xsl] apply-template inside xsl:variable returns a documentFragment with a child node tree From: David Carlisle <davidc@xxxxxxxxx> Date: Fri, 24 Feb 2006 11:10:05 GMT |
If you are using XSLT1 then if you use xsl:variable with content rather than a select attribute then it makes a "result tree fragment" the only thing you can do with an RTF is copy it to the output or use it as a string, you can not use XPath to query into its structure. this is an annoying limitation that is (will be) gone in XSLT2 and almost all XSLT1 engines (with mozilla being an exception) offer a node-set() extension function that will convert a result tree fragment to a node set (consisting of a single root note, /) so you could then do something like select="x:node-set($thisContent)/element" Note that this is a _copy_ of the element in your source file not the original element as would have been selected if you'd gone select="content/elements/element.".. David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] apply-template inside xsl:var, John P. Flanigan [So | Thread | RE: [xsl] apply-template inside xsl, Florent Georges |
[xsl] apply-template inside xsl:var, John P. Flanigan [So | Date | RE: [xsl] An all-in-one XML data se, Vasu Chakkera |
Month |