xsl-list
[Top] [All Lists]

Re: [xsl] Using XSLT to build an index

2011-10-31 07:38:33
On 31/10/2011 12:05, Mark wrote:
<xsl:for-each-group select="Text" group-by="tokenize(@data,'\s+')">
<xsl:for-each select="current-group()">
<xsl:sort select="current-grouping-key()" lang="cz"/>
<Word title="{@title}" ref="{@ref}">
<xsl:value-of select="."/>
</Word>
</xsl:for-each>
</xsl:for-each-group>

And received the warning:  "Sort key will have no effect because its
value does not depend on the context item"

The xsl:sort is the first child of xsl:for-each as it iterates through the items in one group, so, as the warning says the grouping-key will be the same for each item.

Perhaps you meant to sort the groups, in which case, move the xsl:sort up a line so it is the first child of xsl:for-each-group.


> and the <xsl:value-of> returns nothing.
your for-each-group is selecting Text elements so each group will just consist of Text elements, so the value-of is taking the string value of an empty element, which is always the empty string.


David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. ________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--