web analytics

Learning XPath Expressions By Examples

Options
@2016-01-16 13:25:49

Select all odd-numbered chapters

/book/chapter[position() mod 2 = 1]

 

@2016-01-16 13:27:53

Select every third chapters

/book/chapter[position() mod 3 = 0]

 

@2016-01-16 14:11:35

Select all the descendant nodes in chapter 3

/book/chapter[3]/descendant::*

 

@2016-01-16 14:14:02

Select chapter 3 and its all the child nodes

/book/chapter[3]/descendant-or-self::*

 

Comments

You must Sign In to comment on this topic.


© 2024 Digcode.com