This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]