XPath getting parent node

Please support our XML, XSLT and XPATH advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jun 2006
Posts: 8
Reputation: scott_rider is an unknown quantity at this point 
Solved Threads: 0
scott_rider's Avatar
scott_rider scott_rider is offline Offline
Newbie Poster

XPath getting parent node

 
0
  #1
Feb 17th, 2009
I want to get the table node where its decendent node="Nohup Files".
What I have so far is

table/descendant::font[self::text()="Nohup Files"]
table/tr/td/b/font[self::text()="Nohup Files"]

but neither works.

<table>
<tr>
<td><b><font>Nohup Files</font></b></td>
</tr>
</table>
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 8
Reputation: scott_rider is an unknown quantity at this point 
Solved Threads: 0
scott_rider's Avatar
scott_rider scott_rider is offline Offline
Newbie Poster

Re: XPath getting parent node

 
0
  #2
Feb 17th, 2009
In my fumblings, I was able to piece together this: //font[self::text()="Nohup Files"]/ancestor::table.

I had to select the node I wanted, specified the text to search for and the node to return.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the XML, XSLT and XPATH Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC