web analytics

Learning XPath Expressions By Examples

Options
@2016-01-15 23:24:36

Select the last chapter in this book

//chapter[last()]

 

@2016-01-16 09:15:41

How many paragraphs does this book have?

count(//para)

 

@2016-01-16 09:17:32

Select the chapters which have at least 2 paragraphs

//chapter[count(./para)  > 1]

 

@2016-01-16 09:37:39

Select the chapters with their titles contain "XML"

//chapter[contains(title,"XML")]
//chapter[contains(./title,"XML")]
//chapter[contains(title,"XML") = true()

 

]

Comments

You must Sign In to comment on this topic.


© 2024 Digcode.com