[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Handling Repeating XML !!
Is the XML you have shown fixed or are you allowed to change the xml ? because, by the look of it, it doesnt look like it is properly designed.. for instance, your xml could be .. <?xml version="1.0" encoding="UTF-8" standalone ="yes"?> <A> <B> <Data id = "1">Data11</Data> </B> <C> <Data id = "2">Data21</Data> </C> <D> <Data id = "3">Data31</Data> </D> <B> <Data id = "1">Data12</Data> </B> <C> <Data id = "2">Data22</Data> </C> <D> <Data id = "3">Data32</Data> </D> </A> You normally dont want to keep separate nodes just to differentiate the types of logically same node. With the above structure, you can do <xsl:template match = "A"> <xsl:apply-templates select = "//Data"/> </xsl:template> <xsl:template match = "Data"> <xsl:value-of select = "."/> <br/> </xsl:template> if you still want to continue with your XML , this will work. <xsl:template match="A"> <xsl:apply-templates select="*"/> </xsl:template> <xsl:template match="*"> <xsl:value-of select = "."/> <br/> </xsl:template> But as I said, It is best to restructure your XML as Above. HTH Vasu From: "rajasekhar v" <bigfundu@xxxxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Handling Repeating XML !! Date: Mon, 23 Aug 2004 16:34:15 +0530 _________________________________________________________________ Stay in touch with absent friends - get MSN Messenger http://www.msn.co.uk/messenger
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|