Ivan
Ivan

Reputation: 64207

Are there any common conventions in converting between XML and JSON?

Are there any common conventions in converting between XML and JSON when precise backward convertibility is desired?

For example I've googled to a website which adds - to XML tag attributes to be encoded in JSON and represents multiple same-tag XML entries as an array named exactly the tag name (in singular form), are these ways accepted any widely or specific to that website?

Upvotes: 0

Views: 162

Answers (1)

Michael Kay
Michael Kay

Reputation: 163322

There are a number of conventions in use. Those that produce the most usable JSON tend to sacrifice round-tripping; those that are lossless (and can handle arbitrary XML) tend to produce JSON that is difficult to process.

Upvotes: 1

Related Questions