Subject: Re: [xsl] writing out of the current boundary of an element From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx> Date: Mon, 20 Nov 2006 11:13:12 +0000 |
Hi,
I need to write an element outside the boundary of the "current()" element which is being written to the output file.
for example having the output below written by my XSLT and considering that I am filling the values inside the inner, I need to write another element, as a child of <test:Base>, but based on the values I obtain while I am writing the inner element:
<test:Base> <test:Rule> <test:Inner> #### </test:Inner> </test:Rule> </test:Base>
so I need the output to be like this:
<test:Base> <!--------------The new part--------------------> <test:newlyAdded> ********* </test:newlyAdded>
<test:Rule> <test:Inner> #### </test:Inner> </test:Rule> </test:Base>
<xsl:template match="test:Base"> <test:newlyAdded> ********* </test:newlyAdded> <xsl:apply-templates/> </xsl:template>
If you need the <test:newlyAdded> element to be different depending on the contents of <test:base>, then you can use predicates, eg:
<xsl:template match="test:Base[test:Rule/test:Inner = 'xyz']"> <test:newlyAdded>xyz</test:newlyAdded> <xsl:apply-templates/> </xsl:template>
The problem here is your question and examples are pretty underspecified, eg you say "based on the values I obtain" but don't show the values or what output should correspond to what value...
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] writing out of the curren, Florent Georges | Thread | Re: [xsl] writing out of the curren, Florent Georges |
Re: [xsl] Grouping and Insertion, Florent Georges | Date | Re: [xsl] writing out of the curren, Florent Georges |
Month |