Subject: RE: [xsl] Conditional Assigining From: "Sri ni" <srini75@xxxxxxxxxxx> Date: Thu, 17 May 2001 11:21:14 -0000 |
Here is my xml section.xml ---------------- <Section>
<Section> <sectionID>19</sectionID> <parentID>10</parentID> <bulletinID>1</bulletinID> <groupID>1</groupID> <dictionaryID>1012</dictionaryID> <text>Section 1.1.1.1</text> </Section> <Section>
My xsl: ---------- <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:apply-templates select="First"/> </xsl:template>
<xsl:template match="First"> <!--<xsl:for-each select="Section[parentID='0']"> --> <xsl:for-each select="Section"> <xsl:variable name="ID" select="sectionID"/> <xsl:value-of select="text"/> <xsl:for-each select="../Section[parentID=$ID]"> <xsl:value-of select="text"/><br/> <xsl:variable name="ID" select="sectionID"/> <!-- currentID = <xsl:value-of select="$ID" />--> </xsl:for-each> <!-- <xsl:variable name="ID" select="sectionID"/> sectionid afterloop= <xsl:value-of select="$ID" />--> <!-- <xsl:variable name="ID" select="text"/> text afterloop = <xsl:value-of select="$ID" />-->
</xsl:for-each> </xsl:template>
CURRENT OUTPUT: ----------------- id 1 pid 0 text Section 1
id 5 pid 1 text Section 1.1
id 10 pid 5 text Section 1.1.1
id 19 pid 10 text Section 1.1.1.1
Desired Output =============== id 1 pid 0 text Section 1
id 5 pid 1 text Section 1.1
id 10 pid 5 text Section 1.1.1
id 19 pid 10 text Section 1.1.1.1
id 11 pid 1 text Section 1.2
Thanks in advance, Srini
_________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Conditional Assigining, Jeni Tennison | Thread | RE: [xsl] Root node vs element root, James Eberhardt |
[xsl] xsl:variable within xsl:choos, Rene de Vries | Date | Re: [xsl] [xsl] £ character referen, Miloslav Nic |
Month |