[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Using xsl:key to list unique nested values
At 2002-01-08 12:46 +1100, Trem Stamp wrote:
I can get the listing of Unique customers Try doing only localized grouping with variables (solution below). You'll see that I am only grouping the projects on the collection of records for each customer. I hope this helps. ................... Ken
t:\ftemp>type stamp.xsl <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text"/> <xsl:template match="/"> <xsl:variable name="prorows" select="/*/PROROW"/> <xsl:for-each select="$prorows"> <xsl:if test="generate-id(.)= generate-id($prorows[name=current()/name])"> <xsl:value-of select="name"/>: <xsl:text/> <xsl:variable name="custs" select="$prorows[name=current()/name]"/> <xsl:for-each select="$custs"> <xsl:if test="generate-id(.)= generate-id($custs[project_name= current()/project_name])"> <xsl:text> </xsl:text> <xsl:value-of select="project_name"/> <xsl:text> </xsl:text> </xsl:if> </xsl:for-each> </xsl:if> </xsl:for-each> </xsl:template> </xsl:stylesheet> t:\ftemp>xt stamp.xml stamp.xsl stamp.txt t:\ftemp>type stamp.txt Customer 1: Project 1 Project 2 Customer 2: Project 1 Project 4 t:\ftemp>
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 (Fax:-0995) ISBN 0-13-065196-6 Definitive XSLT & XPath ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath ISBN 1-894049-07-1 Practical Formatting Using XSLFO XSL/XML/DSSSL/SGML/OmniMark services, books(electronic, printed), articles, training(instructor-live,Internet-live,web/CD,licensed) Next public training: 2002-01-10,11,16,18,02-11,12,13,15,18,21, - 03-11,14,15,18,19,04-08,09,10,12 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|