Standard approaches/libraries for XML-to-JSON conversion



I'm working on a schema-driven XML-JSON conversion library. My library is based on mappings - there's a JSON mapping which describes how XML should be represented in JSON form. Mappings can be generated from the XML Schema.


All of this works just find but I would also like to support mappingless conversion additionally. So that even if you don't provide a mapping, you'll still get reasonable results when unmarshalling from/marshalling to XML.


I've started wondering if there is some "standard" (popular/widely accepted in the community) way to represent XML structures in JavaScript. I've found quite a few things (for instance here's one and another), but it's hard to say which one is more or less widely accepted.


This is why I'd like to ask the community for pointers to standard approaches to XML representation in JSON.


My main requirement is that marshall(unmarshall(xml)) should give the same xml. This includes supporting attributes, elements, text nodes, ideally also namespaces and somehow maintaining the order of values.


I'd be grateful for pointers to popular specs/rules/implementing libraries which more or less match my requirements.


No comments:

Post a Comment