Subject: Re: [xsl] mixed content grouping by whitespace From: David Carlisle <davidc@xxxxxxxxx> Date: Tue, 13 Apr 2010 18:09:54 +0100 |
As I see it and have no problems remembering it:
group-by and group-adjacent are based on values, group-starting-with and group-ending-with are based on names.
I'm not really sure what you are trying to say there, David. And in what you are trying to say are you accommodating the feature of using a sequence in group-by= in order to place a single population member into more than one group simultaneously? I need to include a running example of that in the classroom to help convey that concept to students.
$ saxon9 -it main grp.xsl <?xml version="1.0" encoding="UTF-8"?> <grouping-nodes> <group> <h2>heading 1</h2> <h2>heading 2</h2> </group> <group> <p> para 1.1</p> <p> para 1.2</p> <p> para 2.1</p> <p> para 2.2</p> </group> </grouping-nodes> <grouping-items> <group>0 2 0 4</group> <group>1 3</group> </grouping-items> <grouping-nodes-without-reordering> <group> <h2>heading 1</h2> <p> para 1.1</p> <p> para 1.2</p> </group> <group> <h2>heading 2</h2> <p> para 2.1</p> <p> para 2.2</p> </group> </grouping-nodes-without-reordering>
<xsl:variable name="x"> <h2>heading 1</h2> <p> para 1.1</p> <p> para 1.2</p> <h2>heading 2</h2> <p> para 2.1</p> <p> para 2.2</p> </xsl:variable>
<grouping-nodes> <xsl:for-each-group select="$x/*" group-by="exists(self::h2)"> <group> <xsl:copy-of select="current-group()"/> </group> </xsl:for-each-group> </grouping-nodes>
<grouping-items> <xsl:for-each-group select="$y" group-by=". mod 2 = 0"> <group> <xsl:copy-of select="current-group()"/> </group> </xsl:for-each-group> </grouping-items>
<grouping-nodes-without-reordering> <xsl:for-each-group select="$x/*" group-starting-with="h2"> <group> <xsl:copy-of select="current-group()"/> </group> </xsl:for-each-group> </grouping-nodes-without-reordering>
<!-- error <grouping-nodes-without-reordering> <xsl:for-each-group select="$y" group-starting-with="0"> <group> <xsl:copy-of select="current-group()"/> </group> </xsl:for-each-group> </grouping-nodes-without-reordering>
<grouping-nodes-without-reordering> <xsl:for-each-group select="$x/*" group-starting-with="exists(self::h2)"> <group> <xsl:copy-of select="current-group()"/> </group> </xsl:for-each-group> </grouping-nodes-without-reordering>
--> </xsl:template>
________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] mixed content grouping by, G. Ken Holman | Thread | Re: [xsl] mixed content grouping by, Wendell Piez |
Re: [xsl] mixed content grouping by, G. Ken Holman | Date | Re: [xsl] The output of evaluating , Dimitre Novatchev |
Month |