|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
Back To School Sale!Save 30% off all Stylus Studio 2008 Products when you purchase from our Online Shop. Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






