![]() |
![]() | ![]() | ![]() | 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 5:09:00 PM > 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. Unless you plan it out beforehand, you can't. OTOH, if you use XPath to navigate around in the original XML, you should be able to do what you want, by changing the order of the transformation. -- HTH, Kevin Spencer Microsoft MVP Ministry of Software Development http://unclechutney.blogspot.com I just flew in from Chicago with a man with a wooden leg named Smith who shot an elephant in my pajamas. So I bit him. "Arnost Sobota" <sabotage@m...> wrote in message news:454c9bbf$0$27403$ba4acef3@n...... > Thank you for your answer. I realise that my statement of the problem was > dramatically confused. > > What my XSLT code is doing is copy the input XML document to the output > document, with some alterations, but on the whole the structure of the > output file follows that of the input file. > (Hence my faulty reference to "context nodes", input and output mishmashed > in my head). > > 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. > (OK, my problem is certainly ill-posed, I'll have to reconsider it with a > fresher mind!) > > Arnost > > Martin Honnen a écrit : >> Arnost Sobota wrote: >> >>> I'm currently developing and XSLT and I'm now facing a problem that >>> would easily be solved *if* I could find a way to create a node) some >>> place else than the XML context node. >> >> The context node is in the input tree where you can't create any nodes at >> all as the XSLT stylesheet creates all new nodes in the result tree. >> >>> I'm inside a xsl:template, so the scope of any XSL action performed here >>> is the matching XML node. What I'd like is to overcome this limitation >>> by being able to perform an action outside this context node (in a node >>> that I would explicitly indicate, of course). >> >> It is not clear what the problem is, provide a minimal XML input, show us >> the relevant part of the stylesheet and we might be able to tell you >> more. >> As already said, the input tree with context nodes is completely >> different from the result tree the XSLT stylesheet creates. >> Then in the XSLT stylesheet you can of course call other templates with >> xsl:call-template, you can access any node with absolute XPath if needed, >> you can access any node relative to the content node. >> | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
