[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Re: select distinct

Subject: Re: Re: select distinct
From: "Noel Golding" <noel@xxxxxxxxxxxxxxx>
Date: Tue, 17 Sep 2002 10:36:40 -0400
select distinct text
Thanks for the link, however it stills seems a little over my head. How to
get all the unique <ref/> elements?

<!-- XML snippet -->
<document>
    <section>
        <para>text text text text <ref name="a1" /> text text text.</para>
    </section>
    <section>
        <para>text text text text <ref name="y1" /> text text text.</para>
    </section>
    <section>
        <para>text text text text <ref name="b4" /> text text text.</para>
    </section>
    <section>
        <list type="number">
            <listitem><ref name="a1" /></listitem>
            <listitem><ref name="ko" /></listitem>
            <listitem><ref name="7u" /></listitem>
            <listitem><ref name="y1" /></listitem>
            <listitem><ref name="b4" /></listitem>
        </list>
    </section>
</document>

<!-- Desired output -->
<ref name="a1" />
<ref name="y1" />
<ref name="b4" />
<ref name="ko" />
<ref name="7u" />

I assume my xsl:key element would look like

<xsl:key name="name-of-unique-list" match="ref" use="@name" />

but then how do I make sure I am matching on all ref elements regardless of
where they are located in the document?

what would my xsl:template @match value be?
what would my xsl:for-each @select value be?

<xsl:key name="name-of-unique-list" match="ref" use="@name" />
<xsl:template match="???">
    <xsl:for-each select="???">
        ???
    </xsl:for-each>
</xsl:template>

Thanks for you help
Noel



----- Original Message -----
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, September 16, 2002 1:28 PM
Subject:  Re: select distinct


>
> [skip]
>
> > I would like to get all the unique <ref /> elements.
> >
> > <ref name="a1" />
> > <ref name="a2" />
> >
> > I am not sure what my xsl should look like to accomplish this.
> >
> > Thanks
> > Noel
>
> Read about the Muenchian method for grouping. One place where you can
> find this explained is:
>
> http://www.topxml.com/code/default.asp?p=3&id=v20010129150851
>
>
>
>
>
> =====
> Cheers,
>
> Dimitre Novatchev.
> http://fxsl.sourceforge.net/ -- the home of FXSL
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! News - Today's headlines
> http://news.yahoo.com
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.