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

Re: xpath confusion (compound xpath)

Subject: Re: xpath confusion (compound xpath)
From: S Woodside <sbwoodside@xxxxxxxxx>
Date: Tue, 21 Jan 2003 23:52:13 -0500
compound xpath

On Sunday, January 19, 2003, at 02:41 AM, Dimitre Novatchev wrote:


What am I doing wrong?

The problem is here:


<xsl:when test="/grammar/start/element/zeroOrMore/choice/element[1]// zeroOrMore//*[self=current()]">

You are testing if the current node has child named "self" and its string value is equal to the string value of the current node.

gah! I can't believe it. I must have though I was using the self:: axis. Would self::* have worked? How do I know if it's going to treat the stuff inside the predicate as a string or as a node-set?


I find the XPath spec to be unusually confusing ... would you mind pointing out the part of the spec that defines this, because it's totally unclear to me. In fact, I find there's a distinctive lack of clear documentation on the net. I'd rather not have to waste the money and dead trees on the O'Reilly book and usually the online docu is enough for me.

Obviously, you wanted:

/grammar/start/element/zeroOrMore/choice/element[1]//zeroOrMore//
*[generate-id() = generate-id( current())]

Thanks,


simon
---
www.simonwoodside.com


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.