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

Re: xpath confusion

Subject: Re: xpath confusion
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Thu, 3 Jul 2003 10:47:02 +0100
xpath type
Hi Bodrul,

> XPath: "Root/Keys/Client[@id="abc"]/ descendant-or-self::text()"
> selects 0 nodes. 
>
> Please can someone explain to me why the last xpath doesn't select 3
> nodes.

I guess that whatever XSLT processor you're using (probably MSXML) is
stripping the whitespace-only text nodes (there should be four of
them) between the elements/comments.

> I would like to select the 3 nodes <Client>, <a /> and <b />. Any
> help is appreciated.

In other words, following the pattern of the other paths that you've
been trying, the three elements in the descendant-or-self axis from
the <Client> element:

  Root/Keys/Client[@id = "abc"]/descendant-or-self::*

* matches element nodes in this context because the "principal node
type" of the descendant-or-self axis are element nodes.

(In XSLT 2.0, you can also use "element()" as a node test that matches
all elements.)

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.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.