Import XML to SQL DB



Could you please advise how can i import an XML file with the below structure into a SQL DB



<?xml version="1.0" encoding="UTF-8" ?>
- <Hotels>
- <Hotel>
<HotelCode>XXXXXX</HotelCode>
<OldHotelId>X/XXXXXXXX</OldHotelId>
<DestinationId>XXXX</DestinationId>
<Destination>Name of city</Destination>
<Country>Name of country</Country>
<HotelName>Hotel Name</HotelName>
<StarRating>x</StarRating>
<HotelAddress>Hotel address</HotelAddress>
<HotelPostalCode>Zip Code</HotelPostalCode>
<HotelPhoneNumber>Hotel phone number</HotelPhoneNumber>
<HotelArea>Hotel area</HotelArea>
<Chain>Hotel Chain</Chain>
- <Coordinates>
<Latitude>latitude</Latitude>
<Longitude>longitude</Longitude>
</Coordinates>
- <HotelImages>
<ImageURL>URL1</ImageURL>
<ImageURL>URL2</ImageURL>
<ImageURL>URL3</ImageURL>
</HotelImages>
</Hotel>
- <Hotel>
....
</Hotel>
....
</Hotels>


The file has over 200 mb and it would be great to import the file from a php script ...or something


Any advise will be helpfull. Regards


No comments:

Post a Comment