Solved

XML Feed to input into Database part 2

Posted on 2010-09-06
6
467 Views
Last Modified: 2012-05-10
Hi,

The XML feed will contain 11,000 properties.

I have asked the provider of the feed to provide a database schema as when I try to import it into access into a blank database, it mixes the data and structure.

What is the best way to get this data into a database so that I can use the data properly?

Thanks,

Ben
file does not appear to have any style information associated with it. The document tree is shown below.

      

-

<root>

-

<resalesonline>

<feed_version>1.0</feed_version>

</resalesonline>

-

<property>

<id>R40659</id>

<status_date>2009-11-12 18:20:28</status_date>

<status>Available</status>

<listed_date>2008-03-12 00:00:00</listed_date>

<ref/>

<price>550000</price>

<currency>EUR</currency>

-

<type>

<uk>Apartment</uk>

<es>Apartamento</es>

</type>

-

<subtype>

<uk>Middle Floor</uk>

<es>Planta Media</es>

</subtype>

<country>Spain</country>

<province>Cádiz</province>

<town>Sotogrande</town>

<area>Costa del Sol</area>

<beds>3</beds>

<baths>2</baths>

<levels>1</levels>

-

<surface_area>

<built>147</built>

<terrace>54</terrace>

<plot>0</plot>

</surface_area>

<own_property>0</own_property>

<has_pool>1</has_pool>

<has_garden>1</has_garden>

<has_garage>0</has_garage>

-

<characteristics>

-

<category id="1">

-

<name>

<uk>Setting</uk>

<es>Posición</es>

</name>

-

<value id="1">

<uk>Close To Port</uk>

<es>Cerca de Puerto</es>

</value>

-

<value id="2">

<uk>Close To Shops</uk>

<es>Cerca de Tiendas</es>

</value>

-

<value id="3">

<uk>Close To Sea</uk>

<es>Cerca del Mar</es>

</value>

</category>

-

<category id="2">

-

<name>

<uk>Condition</uk>

<es>Estado</es>

</name>

-

<value id="1">

<uk>Excellent</uk>

<es>Excelente</es>

</value>

</category>

-

<category id="3">

-

<name>

<uk>Pool</uk>

<es>Piscina</es>

</name>

-

<value id="1">

<uk>Communal</uk>

<es>Comunitaria</es>

</value>

</category>

-

<category id="4">

-

<name>

<uk>Features</uk>

<es>Caracteristicas</es>

</name>

-

<value id="1">

<uk>Covered Terrace</uk>

<es>Terraza Cubierta</es>

</value>

</category>

-

<category id="5">

-

<name>

<uk>Furniture</uk>

<es>Muebles</es>

</name>

-

<value id="1">

<uk>Fully Furnished</uk>

<es>Amueblada</es>

</value>

</category>

-

<category id="6">

-

<name>

<uk>Kitchen</uk>

<es>Cocina</es>

</name>

-

<value id="1">

<uk>Fully Fitted</uk>

<es>Equipada</es>

</value>

</category>

-

<category id="7">

-

<name>

<uk>Garden</uk>

<es>Jardin</es>

</name>

-

<value id="1">

<uk>Communal</uk>

<es>Comunitario</es>

</value>

</category>

-

<category id="8">

-

<name>

<uk>Security</uk>

<es>Seguridad</es>

</name>

-

<value id="1">

<uk>Gated Complex</uk>

<es>Recinto Cerrado</es>

</value>

</category>

-

<category id="9">

-

<name>

<uk>Utilities</uk>

<es>Servicios Públicos</es>

</name>

-

<value id="1">

<uk>Electricity</uk>

<es>Electricidad</es>

</value>

-

<value id="2">

<uk>Drinkable Water</uk>

<es>Agua Potable</es>

</value>

</category>

</characteristics>

-

<description>

-

<uk>

Beautiful apartment overlooking Sotogrande Marina, only 2 years old, immaculate condition, below market price for quick sale. Spacious rooms, full air conditioning and heating, garage and lock up storage included in the price. Extra large terrace, first to see will buy! Sold unfurnished but furniture can be purchased at agreed price. Ideal for boat lovers, option to purchase your own mooring. Excellent amenities nearby. Internation school 10 minutes drive.

</uk>

-

<es>

Precioso apartamento mirando a la Marina de Sotogrande, sólo 2 años de antigüedad, en impecable estado, habitaciones espaciosas, instalación de aire acondicionado y calefacción a través de todo el apartamento.Garaje y Trastero incluídos en el precio.Enorme terraza.Vistas directamente a la marina de Sotogrande. Se vende sin amueblar pero hay posibilidad de comprar los muebles por separado. Calidades excelentes.

</es>

</description>

-

<images>

-

<image id="1">

-

<url>

http://www.adomainname.com/Database/ReSale/crbcdkulwkkcqbu/Pictures/40659Pic1.JPG

</url>

</image>

-

<image id="2">

-

<url>

http://www.adomainname.com/Database/ReSale/crbcdkulwkkcqbu/Pictures/40659Pic2.JPG

</url>

</image>

-

<image id="3">

-

<url>

http://www.adomainname.com/Database/ReSale/crbcdkulwkkcqbu/Pictures/40659Pic3.JPG

</url>

</image>

-

<image id="4">

-

<url>

http://www.adomainname.com/Database/ReSale/crbcdkulwkkcqbu/Pictures/40659Pic4.JPG

</url>

</image>

-

<image id="5">

-

<url>

http://www.adomainname.com/Database/ReSale/crbcdkulwkkcqbu/Pictures/40659Pic5.JPG

</url>

</image>

-

<image id="6">

-

<url>

http://www.adomainname.com/Database/ReSale/crbcdkulwkkcqbu/Pictures/40659Pic6.JPG

</url>

</image>

-

<image id="7">

-

<url>

http://www.adomainname.com/Database/ReSale/crbcdkulwkkcqbu/Pictures/40659Pic7.JPG

</url>

</image>

-

<image id="8">

-

<url>

http://www.adomainname.com/Database/ReSale/crbcdkulwkkcqbu/Pictures/40659Pic8.JPG

</url>

</image>

</images>

</property>

Open in new window

0
Comment
Question by:intangiblemedia
  • 3
  • 2
6 Comments
 
LVL 45

Expert Comment

by:aikimark
ID: 33612216
What version of Access are you using?
0
 
LVL 5

Expert Comment

by:eNarc
ID: 33612279
maybe to remove those - in between all the <>

have you tried just exporting 1 column into xml and then into access? because you've got allot of columns doing such things that of course there would be an error somewhere.
0
 

Author Comment

by:intangiblemedia
ID: 33613145
This is the original file... I copy and pasted an example into notepad.. probably caused a few errors... this should be as I get it from the provider...

Thanks
xmlfeed1.xml
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 45

Accepted Solution

by:
aikimark earned 500 total points
ID: 33613500
I ran the XML through Jiang and can see you will probably need to define 4 tables to hold the imported data.

Notes:
* has_ fields can be converted to boolean after import for ease of use.
* the description table can be part of the property table, if you want it to be.  I've found that keeping memo fields in a separate table can make for snappier query performance.
* I don't see a need for the resalesonline data
* propID is the id value in the (related) property table entry. ("R40659", "R40662", "R40666", etc.)
* although I have the status_date and listed_date columns defined as text, you might be able to convert these values during import and define the fields as datetime.

TABLE: property

id  text

status_date text

status  text

listed_date  text

ref  text

price  Long

currency  text

type_uk  text

type_es  text

subtype_uk  text

subtype_es  text

country  text

province  text

town  text

area  text

beds  Long

baths  Long

levels  Long

built  Long

terrace  Long

plot  Long

own_property  Long

has_pool  Long

has_garden  Long

has_garage  Long



=========================

TABLE: characteristics

propID  text

charid  Long

charname_uk  text

charname_es  text



=========================

TABLE: characteristics

propID  text

charid  long

catid  Long

catvalue_uk  text

catvalue_es  text



=========================

TABLE: description

propID  text

desc_uk memo

desc_es memo



=========================

TABLE: images

propID  text

imageid  Long

imageurl  text

Open in new window

0
 
LVL 45

Expert Comment

by:aikimark
ID: 33616278
@intangiblemedia

Did you mean to accept my comment as the answer?  I've only addressed the mapping of the data.
0
 

Author Comment

by:intangiblemedia
ID: 33616357
Yes, I think I can create an access database and then do an XML import without any further advice needed. I would like of course to map out the fields better, for example, property type would be a separate table so that the database is more relational but you have pointed me in the right direction.

Thank you.
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
MS Access 2010 Form Building 3 23
Test ddwrt:UserLookup 1 24
Search field on a form 7 17
Index Details in SQL Server 2012 4 18
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now