Skip to content Skip to sidebar Skip to footer

How To Do Xpath Or Xml Parsing In Android

I have string variable which contains XML of the form: abcdef I want to the di

Solution 1:

I want to the display the title text

You need to evaluate an XPath expression like:

/item/title/text()

this selects any text node (in your case just a single one) that is a child of a title that is a child of the top element named item

Or, to get the string directly, evaluate this XPath expression:

string(/item/title)

Post a Comment for "How To Do Xpath Or Xml Parsing In Android"