Solved

XPath to select all nodes below a specified /tr

Posted on 2011-09-15
3
245 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
  • 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now