getting data from XML and insert it into a databas
Hi all, I have a customer list xml file that contains the folowing data:
<?xml version="1.0" ?>
<CustomerList>
<Identification>
<ID>1</ID>
<Name>John </Name>
</Identification>
<Order>
<OrderNr>2</OrderNr>
<customerNr>100</customerNr>
<customerName>XXXX YYYYY</CustomerName>
</Order>
<Location>
<ID>1</Location>
<Place>NY</Place>
</Location>
<Identification>
<ID>2</ID>
<Name>David</Name>
</Identification>
<Order>
<OrderNr>3</OrderNr>
<customernrNr>200</customerNr>
<customerName>zzzzz vvvv</CustomerName>
</Order>
<Location>
<ID>2</Location>
<Place>NY</Place>
</Location>
<Identification>
<ID>1</ID>
<Name>John </Name>
</Identification>
<Order>
<OrderNr>6</OrderNr>
<customernrNr>300</customerNr>
<customerName>KKKK LLLL</CustomerName>
</Order>
<Location>
<ID>3</Location>
<Place>AR</Place>
</Location>
</CustomerList>
I want to collect the ID value from Identification Node and OrderNr from Order Node and Insert them in a table (xmlTestTable) having ID and OrderNr as fields.
NB: ID from Identification and ID from Location are the same.
Can experts help me how to do it. Any sample code is apreciated. Thank you in advance
|