XPATH with a table and containing keyword
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 1
- Joined: Tue Oct 17, 2017 12:40 pm
XPATH with a table and containing keyword
Hi guys,
I have few tabs in my html and one of these tabs contains a table. Problem is that the position of specific tab changes.
Normally I would use for example:
//div[@id='TabbedPanels1']/div/div[6]/table/tbody/tr[2]/td[3]
as in this case the tab im interested in is 6th from left (div[6]).
But now instead of div[6] i need to put 'contains "name"' but I have no idea how to combine that with my code. I'd appreciate any help!
thanks
I have few tabs in my html and one of these tabs contains a table. Problem is that the position of specific tab changes.
Normally I would use for example:
//div[@id='TabbedPanels1']/div/div[6]/table/tbody/tr[2]/td[3]
as in this case the tab im interested in is 6th from left (div[6]).
But now instead of div[6] i need to put 'contains "name"' but I have no idea how to combine that with my code. I'd appreciate any help!
thanks
-
- Posts: 846
- Joined: Mon Dec 05, 2011 6:04 pm
Re: XPATH with a table and containing keyword
Hi Grumish,
If I correctly understood, you want to select a table cell from some "div" node(s) that is/are grandchild(ren) of the "div" element whose id is 'TabbedPanels1'.
You could try something like: if you need to select from all the "div" grandchildren nodes that contain 'name'
and if you need to select only from the 1st grandchildren node containing "name"
I hope this helps!
Costin
If I correctly understood, you want to select a table cell from some "div" node(s) that is/are grandchild(ren) of the "div" element whose id is 'TabbedPanels1'.
You could try something like:
Code: Select all
//div[@id='TabbedPanels1']/div/div[contains(., 'name')]/table/tbody/tr[2]/td[3]
and
Code: Select all
//div[@id='TabbedPanels1']/div/div[contains(., 'name')][1]/table/tbody/tr[2]/td[3]
I hope this helps!
Costin
Costin Sandoi
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
Return to “General XML Questions”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service