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

Re: How to select a node based on its siblings?

Subject: Re: How to select a node based on its siblings?
From: Peng Yu <pengyu.ut@xxxxxxxxx>
Date: Sat, 1 Oct 2011 14:54:26 -0500
Re:  How to select a node based on its siblings?
On Sat, Oct 1, 2011 at 12:39 PM, Martin Honnen <Martin.Honnen@xxxxxx> wrote:
> Peng Yu wrote:
>>
>> Hi,
>>
>> I want to select<input ...>  based on the fact the its sibling<label
>> ...>  has the number 1. I looked at xpath manual, but I'm not sure how
>> to use xpath to select based on siblings. Could anybody let me know?
>>
>> <td class="checkBoxMargin fontColorGrey alignTextCenter" valign="top"
>> scope="row">
>> <input id="eid_2-s2.0-78650811198" type="checkbox" onclick="return
>> selectDeselectResult(document.SearchResultsForm, this);"
>> value="2-s2.0-78650811198" name="selectedEIDs">
>> <br>
>> <label for="eid_2-s2.0-78650811198">
>> <span class="hidden-label">result</span>
>> 1
>> </label>
>> </td>
>
>  //input[following-sibling::label[normalize-space() = 1]]
>
> to check only following siblings or
>
>  //input[following-sibling::label[normalize-space() = 1] |
> preceding-sibling::label[normalize-space() = 1]]
>
> to check both following and preceding siblings.

I tried your xpath in Seleinum IDE. But I doesn't work as expected. I
want to reduced the problem to a simpler task. How to match the
following structure where the text is "1"?

<label for="eid_2-s2.0-78650811198">
<span class="hidden-label">result</span>
1
</label>

--
Regards,
Peng

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.