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

Re: Can not select outer node

Subject: Re: Can not select outer node
From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx>
Date: Fri, 25 Jan 2008 09:21:06 +0530
Re:  Can not select outer node
On Jan 25, 2008 8:55 AM, Sean Tiley <sean.tiley@xxxxxxxxx> wrote:
> There can be many <table/> elements in the document. I know the only
> one I am interested in
> is the <table/> with the value "Test Case ID" in the first column of
> the first row.

You can get reference to such 'table' element as follows

/testsuite/table[tr[1]/td[1] = 'Test Case ID']

>
> I am trying to get this table so I can process it by grabbing each row
> and extracting the desired info.
>
> I have tried //table/tr[starts-with(td,"Test Case ID")]
> Which returns the first <tr/> in the correct table but I need the entire table.

Here you are asking for the 'tr' node; and that's what you are
getting. So this expression is wrong for your requirement, as you
yourself wrote.

>
> I think using table[1] somehow should work, but clearly I am not getting this
> as when I try //table[1]/tr[starts-with(td,"Test Case ID")] nothing is returned.

This would also return the 'tr' node (because, that's what you are
asking for). As I suggested in my expression, you need to point to the
level of 'table' (with predicate to filter such a table).


-- 
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-2007 All Rights Reserved.