Xpath Syntax not working
-
<item>Sample Product Name</item>
<url>www.example.com</URL>
<date>2013-09-05</date>
<author>dummy</author>
<name>Author4</name>
<img>www.example.com/img.jpg</img>
</item><item>Sample Product Name2</item>
<url>www.example.com</URL>
<date>2013-09-10</date>
<author>dummy</author>
<name>Author3</name>
<img>www.example.com/img.jpg</img>
</item><item>Sample Product Name3</item>
<url>www.example.com</URL>
<date>2013-09-15</date>
<author>dummy</author>
<name>Author2</name>
<img>www.example.com/img.jpg</img>
</item>…etc
FYI: <item> is parent and <name> is inner element of <author>.
I used xPath syntax /item[date[contains(.,’2013-09-05′)]] it works out to filter by date
but when I use /item/author/name[contains(.,’author2′)] it didn’t work out to filter by name
I used several expressions like // | nothing worked out.
Complicated syntax won’t work? i.e //item/date | //item/name – Selects all the date AND name elements of all book elements
and more syntax not working i.e node()
- The topic ‘Xpath Syntax not working’ is closed to new replies.