Jump to content

How to convert an XML database?


adamjblakey

Recommended Posts

Hi,

 

I have been working on a site which uses a large XML database (70meg) and have decided against using SimpleXML to work with this and am going to convert the XML database to SQL so it is easier to work with.

 

The database however with be changed once a month as it contains properties. So the database will be completely changed.

 

How would i go about converting the database to SQL?

 

Cheers,

Adam

Link to comment
Share on other sites

Sorry i will try and explain better.

 

I have a XML database which is 70meg the database contains property's abroad. The site needs to connect to the database and run search like e.g. how many bedrooms, bathrooms etc.

 

I don't want to connect directly to the XML DB so i need to transfer all the data in the XML database to a MySQL database so i can work with it using phpmyadmin and php.

 

Hope that makes more sense.

 

Cheers,

Adam

Link to comment
Share on other sites

What if instead of having the properties added to an xml file you provided a method of adding them directly to the database? This would eliminate the need for the xml file all together, make this process easier, and make adding new properties much simpler.

Link to comment
Share on other sites

Hi,

 

I have just realised that i have got a problem here. After looking at the XML date it seems to have extra details which i don't know how to split up.

 

<Property>

<ID>319441</ID>

<Partner_Id>346</Partner_Id>

<Name><![CDATA[]]></Name>

<Reference><![CDATA[CerrNov-WNCV1051]]></Reference>

<Country>Portugal</Country>

<Region><![CDATA[CentralAlgarve]]></Region>

<Location1><![CDATA[Paderne]]></Location1>

<Location2><![CDATA[]]></Location2>

<Type>Villa</Type>

<Investment>N</Investment>

<Price>250000.00</Price>

<Max_Price>0.00</Max_Price>

<Currency>EUR</Currency>

<Bedrooms>3</Bedrooms>

<Short_Description><![CDATA[beautiful new 3 bedroom linked villa of an excellent design and high quality finishings. Fully equipped kitchen with Bosch electrical equipment (washing machine, dishwasher, cooker hob, oven, extractor, micro-wave and fridge/freezer) and many more extras.]]></Short_Description>

<Long_Description><![CDATA[beautiful new 3 bedroom linked villa of an excellent design and high quality finishings. Fully equipped kitchen with Bosch electrical equipment (washing machine, dishwasher, cooker hob, oven, extractor, micro-wave and fridge/freezer) and many more extras.]]></Long_Description>

<Small_Image_URL><![CDATA[http://www.fisksinternational.co.uk/international/uploaded_images/47062_thumb.jpg]]></Small_Image_URL>

<Large_Image_URL><![CDATA[http://www.fisksinternational.co.uk/international/uploaded_images/47062.jpg]]></Large_Image_URL>

<Extra_Images>

<Extra_Image_URL><![CDATA[http://www.fisksinternational.co.uk/international/uploaded_images/47063.jpg]]></Extra_Image_URL>
<Extra_Image_URL><![CDATA[http://www.fisksinternational.co.uk/international/uploaded_images/47064.jpg]]></Extra_Image_URL><Extra_Image_URL><![CDATA[http://www.fisksinternational.co.uk/international/uploaded_images/47065.jpg]]></Extra_Image_URL></Extra_Images>

<Currencies>

<Currency>
<Name>EUR</Name>
<Price>250000.00</Price>
</Currency>

<Currency>
<Name>GBP</Name>
<Price>168900.00</Price>
</Currency>

<Currency>
<Name>USD</Name>
<Price>314994.41</Price>
</Currency>

</Currencies>

</Property>

 

Under <Extra_Images> there is 2 <Extra_Image_URL> and also under <Currencies> there are 3 different currency's. How would i go about adding these as they have the same field names and also i think that there could be only 1 extra image sometimes and also maybe more than 3 currency's.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.