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

RE: Listing single occurrences of namespace labels

Subject: RE: Listing single occurrences of namespace labels
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Wed, 29 Nov 2000 11:28:22 -0000
re listing xml
> 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


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.