Solved

XPath to select all nodes below a specified /tr

Posted on 2011-09-15
3
251 Views
Last Modified: 2012-05-12
I'm trying to cobble together an xpath that will return all rows
below a certain point in the table.

I want all nodes below where this hits.
.//*[@id='DDATransactionTable']/tbody/tr[contains(.,'Posted T')]

Open in new window


Ideas?
Thanks,
-JW
0
Comment
Question by:JustinW
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 36547429
If you want all child nodes just do
.//*[@id='DDATransactionTable']/tbody/tr[contains(.,'Posted T')]/node()

If you want all nodes below that point
.//*[@id='DDATransactionTable']/tbody/tr[contains(.,'Posted T')]//node()
0
 
LVL 1

Author Comment

by:JustinW
ID: 36548362
the second one looks like the first one,
am I missing something?
0
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 36551731
first one is just child nodes, second one has a double "//" so it looks to nodes at any depth
0

Featured Post

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question