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

Re: distinct-values

Subject: Re: distinct-values
From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx>
Date: Wed, 24 Sep 2008 16:38:03 +0530
Re:  distinct-values
Please try this ...

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                        version="2.0">

  <xsl:output method="xml" indent="yes" />

  <xsl:template match="/">
    <absatz>
      <xsl:for-each select="distinct-values(//Link/@ref)">
         <Link ref="{.}" />
      </xsl:for-each>
    </absatz>
  </xsl:template>

</xsl:stylesheet>

On Wed, Sep 24, 2008 at 4:13 PM, Madlik, Monika (LNG-VIE)
<Monika.Madlik@xxxxxxxxxxxxx> wrote:
> Hi,
>
> I've the following XML-file (part of it):
>
> <ReferenceList>
>  <SourceList>
>    <Link ref="wdg://pschyrembel/sozmed/sozmed_artikel/10687759/"/>
>    <Link ref="wdg://pschyrembel/sozmed/sozmed_artikel/10689339/"/>
>    <Link ref="wdg://pschyrembel/sozmed/sozmed_artikel/10689856/"/>
>  </SourceList>
>  <TargetList>
>    <Link ref="wdg://pschyrembel/sozmed/sozmed_artikel-v/10689066/"/>
>    <Link ref="wdg://pschyrembel/sozmed/sozmed_artikel-v/12404611/"/>
>    <Link ref="wdg://pschyrembel/sozmed/sozmed_artikel-v/10691596/"/>
>    <Link ref="wdg://pschyrembel/sozmed/sozmed_artikel/10689856/"/>
>    <Link ref="wdg://pschyrembel/sozmed/sozmed_artikel/10692131/"/>
>    <Link ref="wdg://pschyrembel/sozmed/sozmed_artikel-v/10690342/"/>
>  </TargetList>
> </ReferenceList>
>
> I'd like to create the following out of this:
>
> <absatz>
>  <Link ref="wdg://pschyrembel/sozmed/sozmed_artikel/10687759/"/>
>  <Link ref="wdg://pschyrembel/sozmed/sozmed_artikel/10689339/"/>
>  <Link ref="wdg://pschyrembel/sozmed/sozmed_artikel/10689856/"/>
>  <Link ref="wdg://pschyrembel/sozmed/sozmed_artikel-v/10689066/"/>
>  <Link ref="wdg://pschyrembel/sozmed/sozmed_artikel-v/12404611/"/>
>  <Link ref="wdg://pschyrembel/sozmed/sozmed_artikel-v/10691596/"/>
>  <Link ref="wdg://pschyrembel/sozmed/sozmed_artikel/10692131/"/>
>  <Link ref="wdg://pschyrembel/sozmed/sozmed_artikel-v/10690342/"/>
> </absatz>
>
> The Problem is, how to handle distinct values. The XML-file contains the
> entry "<Link ref="wdg://pschyrembel/sozmed/sozmed_artikel/10689856/"/>"
> following after the element <SourceList> and following after the element
> <TargetList>.
>
> How is it possible, to create a list of distinct values? I tried to use
> distinct-values() but without any result.
>
> Kind regards,
> Monika


-- 
Regards,
Mukul Gandhi

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.