Simple XSLT Question?
- From: Ganesh Muthuvelu <GaneshMuthuvelu@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 18 Jul 2006 16:33:02 -0700
Hello all,
I have a XML as below:
******************
<BLOCK>
<ROW1>
<A>1</A>
<B>2</B>
</ROW1>
<ROW2>
<A>9</A>
<B>3</B>
<C>4</C>
</ROW2>
<ROW3>
<ROW31>
<A>5</A>
<D>6</D>
<E>7</E>
</ROW31>
</ROW3>
</BLOCK>
******************
with which I want to apply 2 rules:
1) Move "ROW3" up and bring the element "ROW2" down.
2) Change the element name "ROW2" to "order"
This is my xsl:
***************
<?xml version="1.0" ?>
<xsl:style*** version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @* "/>
</xsl:copy>
</xsl:template>
<xsl:template match="BLOCK">
<BLOCK>
<xsl:copy-of select="ROW1"/>
<xsl:copy-of select="ROW3"/>
<xsl:copy-of select="ROW2"/>
</BLOCK>
</xsl:template>
<xsl:template match="ROW2">
<xsl:element name="order">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
</xsl:style***>
***************
However, the element "ROW2" does not get changed to "order" but the first
rule works..
Any help is appreciated..
Thanks,
Ganesh
.
- Follow-Ups:
- Re: Simple XSLT Question?
- From: Dimitre Novatchev
- Re: Simple XSLT Question?
- Prev by Date: XmlReader.Create returns none
- Next by Date: Microsoft XML Diff/Patch -- how to output differences
- Previous by thread: XmlReader.Create returns none
- Next by thread: Re: Simple XSLT Question?
- Index(es):
Loading