[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Muenchian Method
>From: "Hewko, Doug" <Doug.Hewko@xxxxxxxxxxxxxxx> >To: "'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'" <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> >Subject: Help with Muenchian Method >Date: Thu, 2 Aug 2001 08:21:09 -0400 >MIME-Version: 1.0 >X-Mailer: Internet Mail Service (5.5.2653.19) >Content-Type: text/plain; > charset="iso-8859-1" > >Does anyone have any working examples for the Muenchian Method? I read the >Jeni's XSL Tuturial on it >(http://www.jenitennison.com/xslt/grouping/index.html) and couldn't make >heads or tails about what I was supposed to code. > >I would like to group an XML file so the HTML would be like this: > GROUP1 > John Smith 555-555-5555 > Jane Smith 111-111-1111 > GROUP2 > Jane Smith 111-111-1111 >************************************************************ >Here's my XML file: > <page> > <pagetitle>Title of my web page</pagetitle> > <teammembers> > <member team1="yes"> > <name> > <given_name>John</given_name> > <last_name>Smith</last_name> > </name> > <phone> > <areacode>555</areacode> > <number>555-55555</number> > </phone> > </member> > <member team1="yes" team2="yes"> > <name> > <given_name>Jane</given_name> > <last_name>Smith</last_name> > </name> > <phone> > <areacode>111</areacode> > <number>111-11111</number> > </phone> > </member> > >************************************************************ >I get no output when I use the following XSL: > ><xsl:stylesheet version="1.0" >xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> > ><xsl:key name="contacts-by-surname" match="member" use="last_name" /> > ><xsl:template match="teammembers"> > <xsl:apply-templates/> ></xsl:template> > ><xsl:template match="member"> > <xsl:for-each select="member[count(. | key('contacts-by-surname', >last_name)[1]) = 1]"> > <xsl:sort select="name/last_name" /> > <xsl:value-of select="name/last_name" />,<br /> > <xsl:for-each select="key('contacts-by-surname', >'name/last_name')"> > <xsl:sort select="name/first_name" /> > <xsl:value-of select="name/first_name" /> >(<xsl:value-of select="phone" />)<br /> > </xsl:for-each> > </xsl:for-each> ></xsl:template> > ></xsl:stylesheet> >************************************************************ -- ====================================================================== B. Tommie Usdin mailto:btusdin@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Phone: 301/315-9631 Suite 207 Direct Line: 301/315-9634 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ====================================================================== 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
|