![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Creating a node outside context node [Thread Next] Re: Creating a node outside context nodeTo: 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/ | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
