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

Re: Re: XPath expression to derive list of distinct el

Subject: Re: Re: XPath expression to derive list of distinct element names
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Thu, 10 Jan 2002 04:41:26 -0800 (PST)
xpath distinct
> doesn't
>   select="$x//*[not(following::*[name()=name(current())])]"
> select all the element nodes in $x that are the last occurrence of an
>   element of that name?
> David
>    I don't think it can be done in XPath 1.0. The "implicit existential equals" in
> XPath works only on node-sets, so it's only useful for eliminating nodes that have
> duplicate string-values, not duplicate values of some other function such as name
> ().
>    Mike Kay 


The expression you're using cannot be evaluated in "pure XPath" -- that is, if XPath
is not instantiated by XSLT. The current() function is provided to XPath only when
its caller is XSLT.

If I'm not wrong, when XPath is instantiated, it must be passed certain parameters.
One of them is a list of variables' name-value pairs, the other is referred to as
"function library".

When for example XPath is initiated through the MSXML DOM (selectNodes(),
selectSingleNode(), etc), no variable definitions are passed to the XPath engine,
and it seems that the function library is empty.

The original question was if this was possible in an XPath expression but "not using

It seems that Mike would be right, unless you come up with another XPath expression,
which does the job, but doesn't contain XSLT-specific functions.


Do You Yahoo!?
Send your FREE holiday greetings online!

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


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.
First Name
Last Name
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.