Subject: Re: AW: [xsl] exlt set.distinct.template.xsl ? From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx> Date: Fri, 15 Mar 2002 10:31:39 +0000 |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
AW: [xsl] exlt set.distinct.templat, "Braumüller, Hans" | Thread | [xsl] anyone use xsl++?, Bryan Rasmussen |
[xsl] got the answer!!, Laura Jenkins | Date | Re: [xsl] Key function using key st, Jeni Tennison |
Month |