Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Creating a node outside context node

From: Martin Honnen <mahotrash@-----.-->
To: NULL
Date: 11/4/2006 3:26:00 PM

Arnost Sobota wrote:

> So the XLST script copies the nodes step by step as the input tree is 
> parsed, and sometimes has to create a new element (<xsl:element/>). When 
> this happens, the new element is placed at the point at which the result 
> tree is currently located. This is obvious.
> 
> What I was asking is: how can I created an element which would be placed 
> not at the current position but at some specified, previously built, 
> node of the result tree.

That is not really possible (at least not in XSLT 1.0 with one single 
transformation), there is one result tree that is built while the XSLT 
instructions are executed. You can store a result tree fragment in a 
variable and insert that later with xsl:copy-of somewhere else in the 
result tree but that is somehow the other way round than you are asking 
for.
Besides that you can, if the XSLT processor has an extension function, 
convert a result tree fragment to a node set and apply XPath on that 
node set again.
But the construction of the result tree is driven by instantiating the 
templates in the order they are processed and those templates are part 
of a well-formed XML document, the XSLT stylesheet.
-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent