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]

RE: Listing single occurrences of namespace labels


> I've been through the XSL-list and know that it is possible to list
> unique values using preceding-sibling,
> but couldn't get it to work when trying to use the local-name() as the
> checking value.

This technique only works for eliminating duplicate string-values of nodes,
not for eliminating duplicates in the results of any other function. That's
because it relies on the semantics of $ns1 = $ns2 to mean "true if there is
a pair of nodes from ns1 and ns2 that have the same string value".

> 
> It may have been the incorrect syntax:
> 
>  <xsl:apply-templates select="book[not(local-name(*//.) =
> preceding-sibling::*//local-name(.))]"/>

It is incorrect. You can't use a function call as a step within a location
path.
And *//. is syntactically correct but fairly meaningless, I don't really
know what you're trying to get at.

I'd suggest using Muenchian grouping for this one: see www.jenitennison.com.
Define a key such as <xsl:key name="k" match="*" use="local-name(*)"/>

Alternatively in Saxon there's:

saxon:distinct(*, saxon:expression('local-name()'))

Mike Kay


 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]