Re: [xsl] Muenchian method on nodes with two or more items for indexing

Subject: Re: [xsl] Muenchian method on nodes with two or more items for indexing
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Fri, 20 Sep 2002 21:46:11 +0200
larry_hayashi@xxxxxxxxxxx wrote:
  <xsl:key name="entries-by-index" match="//LexicalDatabase/*"
use=".//index"/>
       ^^^
Bad idea. I think you actually want to group the "index" elements
by their content:

   <xsl:key name="entries-by-index" match="index" use="."/>
   <xsl:template match="/">
     <xsl:for-each select="//LexicalDatabase//index[generate-id(.)=
            generate-id(key('entries-by-index',index))]">
       <xsl:sort select="." order="ascending" />
       <xsl:variable name="entry"
            select="(ancestor[parent::LexicalDatabase])[1]"/>
       <IndexItem value="{.}">
         <xsl:for-each select="key('entries-by-index', .)">
           <entry base="{$entry/base}"/>
         </xsl:for-each>
       </IndexItem>
     </xsl:for-each>
   </xsl:template>

----- Original Message -----
Uhhhh. I remember times when it was considered
good netiquette to quote only as much as necessary.

J.Pietschmann


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread