Subject: [xsl] Group various elements with empty tags (flat XML structure to hierarcial XML) From: "M Glenties" <mglenties@xxxxxxxxxxx> Date: Thu, 06 Jan 2005 13:55:59 -0500 |
Original XML: ------------ <Record> <id>102</id> <type>O</Type> <count>37</count> <firstname>Joe</firstname> <lastname>Smith</lastname> <initial>A</initial> <street>35 Main Street</street> <city>Moosejaw</city> <country>Sasaktchewan</country> <postal_code>TOEOPO</postal_code> <amount1>1.23</amount1> <amount2>4.56</amount2> <amount3>7.89</amount3> <language>E</language> </Record>
Desired Output: -------------- <Record> <id>102</id> <type>O</Type> <count>37</count> <NAME> <firstname>Joe</firstname> <lastname>Smith</lastname> </NAME> <ADDRESS> <street>35 Main Street</street> <city>Moosejaw</city> <country>Saskatchewan</country> <postal_code>TOEOPO</postal_code> </ADDRESS> <language>E</language> </Record>
<xsl:template match="Record"> <Record> <xsl:apply-templates select="lastname" mode="Name"/> <xsl:apply-templates select="postal_code" mode="PC"/> </Record> </xsl:template>
<xsl:template match="Record/*"> <xsl:copy-of select="."/> </xsl:template>
My output: -------------- <NAME> <firstname>Joe</firstname> <lastname>Smith</lastname> </NAME> <ADDRESS> <street>35 Main Street</street> <postal_code>TOEOPO</postal_code> </ADDRESS>
Thanks for your time, M Glenties
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] xsl-fo repeat page-sequence, Hong Le | Thread | Re: [xsl] Group various elements wi, António Mota |
RE: [xsl] use XSLT or XQuery in Sax, Pieter Reint Siegers | Date | Re: [xsl] Group various elements wi, António Mota |
Month |