|
Subject: Re: [xsl] Reordering elements From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx> Date: Wed, 14 Jun 2006 17:38:39 +0530 |
<Root>
<Story>
xxx
</Story>
<Source>
yyy
</Source>
</Root><!-- identity template; copies everything --> <xsl:template match="node() | @*"> <xsl:copy> <xsl:apply-templates select="node() | @*" /> </xsl:copy> </xsl:template>
<xsl:template match="Story"> <xsl:copy> <xsl:copy-of select="@*" /> <xsl:apply-templates /> <xsl:copy-of select="following-sibling::Source/node()" /> </xsl:copy> </xsl:template>
In this stylesheet, the identity template has been modified for the conditions you have specified.
Regards, Mukul
In a situation where my XML file looks like this:
<Root> <Story> <Source> </Root>
How would I move the <Source> element so that and it's children are now a child of <Story>?
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] Reordering elements, Michael Kay | Thread | [xsl] node comparision for equality, uppaluri satyaprasad |
| [xsl] Smile and know that Microsoft, M. David Peterson | Date | [xsl] Correlate elements in 2 diffe, Leslie Young |
| Month |