web analytics

Learning XPath Expressions By Examples

Options
@2016-01-17 17:34:39

Select all the preceding sibling before the chapter with a title named "XPath"

/book/chapter/title[text()="XPath"]/../preceding-sibling::*

 

@2016-01-17 17:37:01

Select all the paragraphs for which there exists a chapter title named "Stylesheet Basics"

/book/chapter/para[preceding-sibling::title='Stylesheet Basics']

 

@2017-08-30 10:05:17

Get all first <para> elements under all chapters

book/chapter//para[1]

 

@2017-08-30 10:11:57

Get the first <para> element in the book

(book/chapter//para)[1]

 

Comments

You must Sign In to comment on this topic.


© 2024 Digcode.com