Skip to content

Instantly share code, notes, and snippets.

@jerith
Created August 5, 2012 18:42
Show Gist options
  • Save jerith/3266626 to your computer and use it in GitHub Desktop.
Save jerith/3266626 to your computer and use it in GitHub Desktop.
XML:
<?xml version="1.0"?>
<carrot xmlns:jr="http://openrosa.org/javarosa">
<jr:foo>
<bar>one<baz><bar>fraction</bar></baz></bar>
<bar>two</bar>
<bar>three</bar>
</jr:foo>
</carrot>
Test results:
-----
XPath: /carrot/jr:foo/bar/text()
Result: <XPathNodeSet: set([<XPathTextNode 'one'>, <XPathTextNode 'two'>, <XPathTextNode 'three'>])>
-----
-----
XPath: //bar/text()
Result: <XPathNodeSet: set([<XPathTextNode 'fraction'>, <XPathTextNode 'one'>, <XPathTextNode 'two'>, <XPathTextNode 'three'>])>
-----
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment