View Full Version : importing xml into mysql

01-25-2004, 12:19 AM

I have a xml file with complicated structure and lot of information an I want to import this file into a mysql table.
Xml is some that:

- <root>
- <dir name="Algemene Info">
- <dir name="Algemene informatie over uw Gemeente" subtitle="Openingstijden, adres, rechten, informatie, tarieven" prio="3">
- <item id="195" accepted="true" prio="7" lastupdate="3DDB58D" lasteditor="Taken">
<titel>Openingstijden en adres gemeentehuis</titel>
<omschrijving />
<datumuit />
- <body>
- <![CDATA[ <STRONG>U kunt ons op de volgende manieren bereiken:<BR></STRONG>Gemeente Wijk bij Duurstede<BR>Karel de Grotestraat 30,<BR>Postbus 83, 3960 BB Wijk bij Duurstede.<BR>Telefoonnummer: 0343-595595<BR>Telefax: 0343-595599<BR>E-mail: <A href="mailto:info@wijkbijduurstede.nl" target=_blank>info@wijkbijduurstede.nl</A> <BR><BR><
- <item id="196" lastupdate="2116B79" prio="6">
<titel>Tarieven diensten gemeente Wijk bij Duurstede per 1 januari 2003</titel>
<omschrijving />
<datumuit />
- <body>
- <![CDATA[
<TABLE style="FONT-WEIGHT: normal; FONT-SIZE: x-small; COLOR: black; FONT-FAMILY: Arial" cellSpacing=0 cellPadding=0 x:str>
<TD vAlign=top>Paspoort</TD>
<TD vAlign=top x:num="33.37">&nbsp;&nbsp;&nbsp; 35,55 </TD></TR>
<TD vAlign=top>Spoed paspoort</TD>
<TD vAlign=top x:num="33.37">&nbsp;&nbsp;&nbsp;&nbsp;71,70</TD></TR>

and I want to put this information in 2 tables. First table store information about directories(id,subid,name,description) and second table store information about file (items ...) into more fields (name file, description, accept, date, body of file ...)

Who is the efficient method to do that ???

thks a lot and I wait your sugestion

01-27-2004, 02:05 PM
8 words mate...

"print it out and type it back in"

if it was a .csv file it could be done easily, but your xml is just too complex.


01-27-2004, 02:54 PM
3 additional words:
Do not crosspost