Subject: [xsl] Grouping problem From: Terry Ofner <tofner@xxxxxxxxxxx> Date: Tue, 4 Dec 2007 09:58:41 -0500 |
<?xml version="1.0"?> <Root> <State> <!--first standard; first lesson--> <Standard> <SS id="1.4.1">1.4.1 standard text </SS> <Lesson>Prefixes and Suffixes</Lesson> </Standard>
<!--same standard as first; new lesson--> <Standard> <SS id="1.4.1">1.4.1 standard text</SS> <Lesson>Root Words</Lesson> </Standard>
<!--new standard; new lesson--> <Standard> <SS id="1.4.2">1.4.2 standard text</SS> <Lesson>Context Clues</Lesson> </Standard>
<!--two standards grouped with one lesson--> <Standard> <SS id="1.4.5">1.4.5 standard text/SS> <SS id="1.4.6">1.4.6 standard text</SS> <Lesson>Synonyms</Lesson> </Standard> . . . </State> </Root>
<Standard> <SS id="1.4.1">1.4.1 standard text </SS> <Lesson>Prefixes and Suffixes</Lesson> <Lesson>Root Words</Lesson> </Standard>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="no"/>
<xsl:template match="State"> <xsl:for-each-group select="Standard/SS" group-by="@id"> <xsl:for-each select="current-group()"/> <xsl:copy-of select="."/><xsl:text> </xsl:text> </xsl:for-each-group> </xsl:template> </xsl:stylesheet>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Re: [saxon] xslt debugger plu, Dimitre Novatchev | Thread | Re: [xsl] Grouping problem, Andrew Welch |
[xsl] Re: [saxon] xslt debugger plu, Dimitre Novatchev | Date | Re: [xsl] Grouping problem, Andrew Welch |
Month |