Looking at an XML structure like the one below:
<calendar>
<month year="2013" num="5">
<day num="1">
</month>
</calendar>
I decided to convert it to JSON using MDN's JXON Snippet 3. https://developer.mozilla.org/en-US/docs/JXON#Algorithm_.233.3A_a_synthetic_technique
The resulting JSON looks like this:
{"calendar":{
"month":[{
"@year":2013,"@num":5,"day":{
"@num":1
}
}
}]
}
Upon further examination, I realized that the "@" symbol is used in JXON Snippet 3 for attribute manipulation:
vResult["@" + oAttrib.name.toLowerCase()] = parseText(oAttrib.value.trim());
This made me wonder why the "@" symbol was chosen and if there was a specific reason for its use. It seemed odd since accessing attributes like this doesn't seem straightforward:
calendar.month.@year