|
Subject: Re: [xsl] Muenchian method on nodes with two or more items for indexing From: "Larry Hayashi" <larry_hayashi@xxxxxxxxxxx> Date: Mon, 23 Sep 2002 21:40:24 -0500 |
<xsl:for-each select="//LexicalDatabase//index[generate-id(.)=
generate-id(key('entries-by-index',.))]">
^<xsl:variable name="entry"
select="(ancestor::*[parent::LexicalDatabase])[1]"/>
^<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>| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] Muenchian method on nodes, J.Pietschmann | Thread | [xsl] Mutiple values for variable, Kunal H. Parikh |
| [xsl] XSLT model in Java, E L | Date | RE: [xsl] hardware xml / xslt, bryan |
| Month |