I want to do XML Parsing into apex. Please help me to do parsing in apex. see below XML Data.
Please explain me how to do xml parsing into apex to show this XML data into visualforce page and also insert this XML Data into custom object.
<Orders>
<OrderID>3401</OrderID>
<AddressValidated>Y</AddressValidated>
<OrderDetails>
<OrderDetailID>2584</OrderDetailID>
<AutoDropShip>N</AutoDropShip>
<FreeShippingItem>N</FreeShippingItem>
<GiftTrakNumber>0</GiftTrakNumber>
<GiftWrap/>
<GiftWrapCost>0.0000</GiftWrapCost>
<GiftWrapNote/>
<ProductCode>800006</ProductCode>
<ProductID>37506</ProductID>
<ProductName>Wet & Forget Outdoor 1 Gallon</ProductName>
<Shipped>Y</Shipped>
<TotalPrice>34.9900</TotalPrice>
<Warehouses>1</Warehouses>
</OrderDetails>
</Orders>
Best Answer
This post from salesforce.com explains in detail with an example on how to work with XML data in apex.
Edit
I have just used the same code as provided in the link and it should work.