[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Grouping using group-starting-with=
Hi folks,
I'm using Saxon 8.8J and I'm trying to group a bunch of sibling items into groups of items that start with the item that has a particular child with a particular value. It would seem that the following does not work: <xsl:for-each-group select="/*/Item" group-starting-with="RepresentationTerm[.='Code']"> Looking at XSLT 2.0, group-starting-with= requires the population to all be nodes, and there are a number of nodes that match the pattern test supplied ... yet running the example I am only getting a single group ... which I suspect is just the first node in the population. I'm missing something obvious ... could someone please point me to the correct chapter and verse? I have my example below of test data and stylesheet ... my real data has much more information and more representation terms, but it should still be the same. Thanks! . . . . . . . . . . Ken
<xsl:output indent="yes"/> <xsl:template match="/"> <All> <xsl:for-each-group select="/*/Item" group-starting-with="RepresentationTerm[.='Code']"> <Identification> <xsl:value-of select="DictionaryEntryName"/> </Identification> </xsl:for-each-group> </All> </xsl:template> </xsl:stylesheet> t:\ftemp>call xslt2 test.xml test.xsl test.out t:\ftemp>type test.out <?xml version="1.0" encoding="UTF-8"?> <All> <Identification>Allowance Charge Reason_ Code. Type</Identification> </All> -- UBL/XML/XSLT/XSL-FO training: Verx, Denmark 2006-10-02/06,11-20/24 UBL International 2006 2006-11-13/17 http://www.ublconference.com World-wide corporate, govt. & user group UBL, XSL, & XML training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
|
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
|