Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
JLRishe committed Jun 9, 2016
1 parent 8f93951 commit d234e6e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ console.log("node: " + nodes[0].toString())
title: Harry Potter
Node: <title>Harry Potter</title>

## Get text values directly
## Evaluate string values directly:
`````javascript
var xml = "<book><title>Harry Potter</title></book>"
var doc = new dom().parseFromString(xml)
var title = xpath.select("//title/text()", doc).toString()
var xml = "<book><title>Harry Potter</title></book>";
var doc = new dom().parseFromString(xml);
var title = xpath.select("string(//title)", doc);

console.log(title)
console.log(title);
`````

Expand Down

0 comments on commit d234e6e

Please sign in to comment.