Thanks for pointing out.   The assumptions stated work for my data, luckily as 
long as the data is captured, I don't need to differentiate if they are 
attribute or element and ordering is not required.  Those ignored are non 
pertinent data in my context.


Thanks,
Keith

________________________________
From: Thad Guidry <[email protected]>
Sent: Wednesday, June 01, 2016 12:14:32 PM
To: [email protected]
Subject: Re: Which processor to use to cleanly convert xml to json?

Keith,

Hopefully you are aware of some of the pitfalls that you might run into with 
that approach.  But it might be good enough for your particular use case :)

>From org.json.XML

Convert a well-formed (but not necessarily valid) XML string into a JSONObject. 
Some information may be lost in this transformation because JSON is a data 
format and XML is a document format. XML uses elements, attributes, and content 
text, while JSON uses unordered collections of name/value pairs and arrays of 
values. JSON does not does not like to distinguish between elements and 
attributes. Sequences of similar elements are represented as JSONArrays. 
Content text may be placed in a "content" member. Comments, prologs, DTDs, and 
<[ [ ]]> are ignored.

Thad
+ThadGuidry<https://www.google.com/+ThadGuidry>

Reply via email to