function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
David FryDavid Fry 

Incorrect Parsing using XmlParser.xmlToJson & JSON2Apex

Question for those who might have run across this.

I am using the XmLParser class to parse my XML into JSON.

(Class shown here: https://sfcure.com/2019/03/31/xmlparse-in-apex-converting-xml-into-json-or-deserializing-xml/ )
The json is coming out clean, I've verified it.

I then take that JSON and use the JSON2Apex class to deserialize it.  I've looked at the class structure of the JSON2Apex class and it looks good.

 

However for some reason 1 of the elements is coming back null.  The XML and generated JSON both have an element array of size 3.  The JSON2Apex parsing seems to be producing 5 of those elements,  but only 2 of which are actually populated. The rest have null elements.

Has anyone experienced this?  

I'm hesitant to post the code b/c it would  be a lot.  However I will add the code later if nobody has seen this bofre.