xsl-list
[Top] [All Lists]

Re: [xsl] Can someone explain this generate-id and key xsl fragment to me?

2014-02-28 13:34:31
On 28/02/2014 18:17, russurquhart1(_at_)verizon(_dot_)net wrote:
  Hi,

I'm having to manage an xslt that someone else wrote, that generally works 
correctly, but when it doesn't i have problems.

In one template that is a for-each command that is executed. The line is:

<xsl:for-each select="//errata_section[generate-id(.)=generate-id(key('module-index', 
module_impacted)[1])]">
  <xsl:sort select="module_impacted"/>




That is the standard idiom known as Muenchian grouping (google for it) that was used to group items (or remove duplicates0 in XSLT 1. It is largely replaced by xsl:for-each-group in XSLT2.



--~------------------------------------------------------------------
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>
--~--