xsl-list
[Top] [All Lists]

Re: Insert refs

2003-12-17 11:22:52

This is a grouping problem, so use the usual key grouping method:

first key your to elements
<xsl:key mame="to" match="email/to" use="."/>

Then

<xsl:for-each select="email/to[generate-id(.)=generate-id(key('to',.)[1])]">
    <to id="{generate-id()}"><xsl:value-of select="."/></to>
</xsl:for-each>



then


<xsl:template match="to">
 <to ref="{generate-id(key('to',.)[1])}"/>
<xsl:template>



untested...

David

-- 
http://www.dcarlisle.demon.co.uk/matthew

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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



<Prev in Thread] Current Thread [Next in Thread>