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

Re: AW: exlt set.distinct.template.xsl ?

Subject: Re: AW: exlt set.distinct.template.xsl ?
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 15 Mar 2002 10:31:39 +0000
set distinct attribute
Hi Hans,

> to the transformation stylesheet set.distinct.1.xsl, because i want
> to customize the output adding an semi-colon (;) and the second
> adaption was changing copy-of with value-of, to some obtain some
> output.
>
> How can i gain the same result without changing the original
> template from exslt ?

Just to explain the design of the set:distinct (and some of the other
set:*) template...

You cannot return a node set from an XSLT template. Therefore it's
impossible for set:distinct to return the 'distinct' nodes. Instead,
it applies templates to the distinct nodes in 'set:distinct' mode.

What happens to them then is up to you. By default, as you've seen,
they get copied. If you want to get their values, then go ahead and
override the template in set:distinct mode - that's precisely why the
set:distinct template applies templates to the distinct nodes rather
than immediately copying them.

If you simply have a template matching @country attributes in
set:distinct mode within your stylesheet, then you should get what you
want:

<xsl:template match="@country" mode="set:distinct">
  <xsl:value-of select="." />;
</xsl:template>

You don't need to delete the template from the
set.distinct.template.xsl stylesheet, though - since you're importing
it, your template will be used in preference to the one that's in the
utility stylesheet.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 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.