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

Re: Compact XPath syntax

Subject: Re: Compact XPath syntax
From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx>
Date: Wed, 26 Dec 2007 18:17:27 +0530
Re:  Compact XPath syntax
Writing a bit late to this thread ...

On Dec 20, 2007 5:14 AM, Ramkumar Menon <ramkumar.menon@xxxxxxxxx> wrote:
> Consider another XML.
>
> <a>
>  <b>
>     <c>
>  </b>
>  <f>
>     <c>
>  </f>
> </a>
> I could refer to the node "c" as "!c", which matches all "c" nodes at
> all levels. I specify something on the lines of  !c[parent::b] or
> !c[parent::f] to address the respective "c" nodes.

Personally speaking, I find XPath capabilities to address parts of XML
document fine. To my opinion, it's a great language in fact.

In XPath, we write XPath expressions to reach nodes from a context
node. We can use various axes and node types provided, in our
expressions.

Incidentally, for the above example, I would write the expression as:
//c[parent::b]
//c[parent::f]
(in these examples, we filter nodes using a predicate).

or //c (if you want to select all 'c' elements everywhere in the tree).


-- 
Regards,
Mukul Gandhi

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.