xsl-list
[Top] [All Lists]

Re: [xsl] Can not select outer node

2008-01-24 20:51:35
On Jan 25, 2008 8:55 AM, Sean Tiley <sean(_dot_)tiley(_at_)gmail(_dot_)com> 
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>