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
Poorna DeveloperPoorna Developer 

Apex code to Upload/Insert xml file to salesforce object


I need apex (xml) code to upload/Insert address fields in to  account or contact object in salesforce.

ie. in xml I have a code like '<name>Kirk Stevens</name>'+
'<street1>808 State St</street1>'+
'<street2>Apt. 2</street2>'+

after debug this apex code, I want a address field with these address data in account or contact.

Is this possible?
Any help.
SwethaSwetha (Salesforce Developers) 
HI Poorna,
I see  you are trying to update the account/contact records from XML data.You will need to use Dom.XMLNode to parse through XML to fetch the elements . 
See below articles that explain this procedure.You will need to customize it according to your requirement.

If this information helps, please mark this answer as best.