[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
> 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 David, 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 xsl". 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. Cheers, Dimitre. __________________________________________________ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com 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
|