This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Muenchian Method
- To: xsl-list <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] Muenchian Method
- From: Mulberry Technologies List Owner<xsl-list-owner at lists dot mulberrytech dot com>
- Date: Thu, 2 Aug 2001 15:01:18 -0400
- Reply-To: xsl-list at lists dot mulberrytech dot com
>From: "Hewko, Doug" <Doug.Hewko@ccra-adrc.gc.ca>
>To: "'xsl-list@lists.mulberrytech.com'" <xsl-list@lists.mulberrytech.com>
>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@mulberrytech.com
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