|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








