Created
January 9, 2016 00:45
-
-
Save Hamled/076c4c6ca253cb852981 to your computer and use it in GitHub Desktop.
Two different ways to convert an XML document to JSON
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
<petStore> | |
<pets> | |
<dog> | |
<id>515</id> | |
<name>Rusty</name> | |
<breed>ChocolateLabrador</breed> | |
</dog> | |
<dog> | |
<id>516</id> | |
<name>Lulu</name> | |
<breed>Chihuahua</breed> | |
</dog> | |
<cat> | |
<id>572</id> | |
<name>Peanut</name> | |
<breed>Birman</breed> | |
</cat> | |
</pets> | |
</petStore> |
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
{ | |
"petStore": { | |
"pets": { | |
"dogs": [{ | |
"id": 515, | |
"name": "Rusty", | |
"breed": "ChocolateLabrador" | |
}, { | |
"id": 515, | |
"name": "Lulu", | |
"breed": "Chihuahua" | |
}], | |
"cats": [{ | |
"id": 572, | |
"name": "Peanut", | |
"breed": "Birman" | |
}] | |
} | |
} | |
} |
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
{ | |
"petStore": { | |
"pets": [{ | |
"type": "dog", | |
"id": 515, | |
"name": "Rusty", | |
"breed": "ChocolateLabrador" | |
}, { | |
"type": "dog", | |
"id": 516, | |
"name": "Lulu", | |
"breed": "Chihuahua" | |
}, { | |
"type": "cat", | |
"id": 572, | |
"name": "Peanut", | |
"breed": "Birman" | |
}] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment