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

Re: Equivalence between XSL and XPath expression

Subject: Re: Equivalence between XSL and XPath expression
From: xptm <xptm@xxxxxxx>
Date: Sat, 11 Dec 2004 00:54:19 +0000
xpath equivalence
So basically you're saying that the root element doesn't have the self:: axis, besides the obvious ancestor, parent and preceding. Is that so?

Michael Kay wrote:

How can the XPath return 0, if has a context node (.) and has the self axis in ancestor-or-self? This way it has to return at least 1!

I think you are assuming the context node is a menu element. There's no reason to assume that. If the context node is the root (document) node (for example) the XPath expression will return 0.

Michael Kay

Michael Kay wrote:

And the question is: Is this XPath expression


equivalent to this XSL expression?

		<xsl:variable name="position">
			<xsl:number level='any' count="menu"/>

Almost. xsl:number will never return 0, but the XPath

expression might. Take

a look at the XSLT 2.0 spec which defines xsl:number in

terms of equivalent

XPath expressions.

Michael Kay

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.