xsl-list
[Top] [All Lists]

Re: [xsl] eliminating duplicates

2007-05-10 13:56:57
Hi Garvin,

if your using xslt 2.0 it's pretty easy:

        <xsl:for-each-group select="//edge" group-by="@source">
                <xsl:for-each-group select="current-group()" group-by="@target">
                        <xsl:copy>
                                <xsl:copy-of select="@*"/>
                        </xsl:copy>
                </xsl:for-each-group>
        </xsl:for-each-group>

if your using 1.0 you may have to wait for someone with more knowledge of keys.

Spencer

On 5/10/07, Steve <subsume(_at_)gmail(_dot_)com> wrote:
On 5/10/07, Garvin Riensche <g(_dot_)riensche(_at_)gmx(_dot_)net> wrote:
> If there was only one attribute, lets say "source" it would be simple:
> <xsl:for-each
> select="//edge[not(./@source=preceding-sibling::edge/@source)]">
>    <xsl:copy-of select="."/>
> </xsl:for-each>

That wouldn't really work either. That would just assure you didn't
spit out a duplicate of the preceding record.

Someone will surely followup with more comprehensive suggestions about
xsl:key. I'd research it until then. =)

-Steve

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



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

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