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

Re: xpath query

Subject: Re: xpath query
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Fri, 18 Jan 2008 22:05:39 +0100
Re:  xpath query
Senthil Nathan wrote:
hi all,
what could be the xpath query with the foll. xml, to select all the
nodes with apply="1" in the LEVEL2 from ROOT.

<ROOT>
<LEVEL1>
<A>
   <a apply="1">100</a>
   <b apply="1">100</b>
   <c>100</c>
</A>
</LEVEL1>

<LEVEL2>
<B>
   <a>100</a>
   <b apply="1">100</b>
   <c>100</c>
</B>
<C>
   <a>100</a>
   <b>100</b>
   <c apply="1">100</c>
</C>
<LEVEL2>
</ROOT>

I tried using /ROOT/LEVEL2/*[@apply='1']. But it doesn't select the
intended nodes.

It helps if you indent your code correctly, than it easily shows that you missed one axis step:


/ROOT/LEVEL2/*/*[@apply='1']

With indentation I mean this:

<ROOT>
   <LEVEL2>
       <A>
             <a>...</
             <b apply='1'>...</
        </
    </
</

this makes it visually clear that there's still a step between <LEVEL2> and <a>, <b> etc, namely <A>, <B> etc.

HTH,
Cheers,
-- Abel Braaksma

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.