Last active
January 1, 2016 04:19
-
-
Save hbi99/8091472 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var str = '<data><movie>Star Wars</movie><movie>Indiana Jones</movie></data>', | |
doc = Defiant.xmlFromString(str), | |
node = Defiant.node.selectSingleNode(doc, '//movie'); | |
console.log( Defiant.node.prettyPrint( node ) ); | |
// '<movie>Star Wars</movie>' | |
console.log( Defiant.node.prettyPrint( doc ) ); | |
/* | |
<?xml version="1.0" encoding="UTF-8"?> | |
<d:data xmlns:d="defiant-namespace> | |
<movie>Star Wars</movie> | |
<movie>Indiana Jones</movie> | |
</d:data> | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment