You need to sign in to do that
Don't have an account?
code developer
Xml to Apex class deserialise
Hi,
We have https://json2apex.herokuapp.com to deserialize json to apex class.
Similarly I need to deserialise XML to apex class.
Are there any tools like above mentioned url to deserialise xml to apex.
Thanks
Hello,
I could not find any tool for desealizing XML to Apex class. I would suggest you to simply make use of XMLStreamReader class to read the XML and then you can use the result, also if you want to convert XML simply to string then you can use toXmlString from Documnet class.
Refer:http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_xml_XmlStream_reader.htm
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_xml_dom_document.htm
https://github.com/zabroseric/sfdc-xml-parser
It offers both serialization and deserialization. An example of your use case can be seen below: