Create a gist now

Instantly share code, notes, and snippets.

/**
* Original representation
*/
<?xml-stylesheet type="text/xsl" href="xml2json.xslt"?>
<reports xmlns="http://www.w3.org/2005/Atom"
xmlns:georss="http://www.georss.org/georss">
<entry>
<title>A large tree branch is blocking the road</title>
</entry>
</reports>
/**
* Contains all of the above information but is bloated
*/
{
"reports": {
"@xmlns": {
"$": "http://www.w3.org/2005/Atom",
"georss": "http://www.georss.org/georss"
},
"entry": [{
"title": {
"$": "A large tree branch is blocking the road"
}
}]
}
}
/**
* Minimalist and developer centric; doesn't contain foreign information such as XML namespace info
*/
{
"reports": [{
"title": "A large tree branch is blocking the road"
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment