Last active
January 1, 2016 04:29
-
-
Save hbi99/8091717 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><company name="Apple"/>'+ | |
'<user email="steve@apple.com"/>'+ | |
'<movie name="The Godfather"/></data>', | |
doc = Defiant.xmlFromString(str), | |
node = Defiant.node.selectNodes(doc, '//*[@name]'); | |
for (var i=0; i<node.length; i++) { | |
console.log( Defiant.node.prettyPrint( node[i] ) ); | |
} | |
// '<company name="Apple"/>' | |
// '<movie name="The Godfather"/>' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment