RE: [xsl] possible nested loops

Subject: RE: [xsl] possible nested loops
From: "Vasu Chakkera" <vasucv@xxxxxxxxxxx>
Date: Tue, 14 Feb 2006 23:09:14 +0000
i think this is quite straight forward if i understood your question correctly.
lets assume you have an xml,
<country>
<state>
<city/>
<city>
</state>
<state>
<city/>
<city>
</state>
<state>
<city/>
<city>
</state>
</country>


a stylesheet
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:template match="country">
<!--process country nodes-->
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="state">
<!--process state nodes-->
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="city">
<!--process city nodes-->
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>



will basically match templates to all levels.


I mean,if this is what you need,I reckon you must have missed reading the initial chapters of any standard xslt book.

vasu

From: garry@xxxxxxxxxxxxxxxxxxx
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] possible nested loops
Date: Tue, 14 Feb 2006 22:20:57 -0000 (GMT)

I wonder if someone could point me in the right direction to solve my
problem. I need to transform an xml file to html. I have tried to make a
stylesheet but none of my efforts have been successful.
The xml has around 800 pupil records (<pupil>) so I want to iterate over
each pupil node. Within each pupil node there are other nodes which
repeat, so for each pupil I need to iterate over child nodes of which
there may be none or many of each type. I suspect a nested loop of some
sort may help but I have not been able to implement one, any ideas?
regards
garry


_________________________________________________________________
Are you using the latest version of MSN Messenger? Download MSN Messenger 7.5 today! http://messenger.msn.co.uk


Current Thread