"Leo Heber" <le****@gmx.de> wrote in message news:22**************************@posting.google.c om...
Hello,
I need a tool (preferable in PHP to run on every webserver or very
easily accecable by PHP) which can convert data from XML to a
relational DBS (MySQL). I donnot want to stick around with complex
mapping rules, XSLT stuff or XML query languages. The XML should be
mapped automatically to tables. It might be nice, but its not
necessery, to do it the other way round.
Does anyone knows tools (phpscripts) to do this?
Thanks
Personally I have not seen nor looked for such a tool. I know most of today's DB go from table->XML pretty easily, but I have not
seen it the other way.
I assume you would want it to build relations for you and the whole bit?
<users>
<userInfo>
<Name>First guy</Name>
<Address>14 Summer Lane</Address>
<Phone>
<daytime>303-555-1212</daytime>
<evening>404-555-1212</evening>
</Phone>
</userInfo>
<userInfo>
<Name>Second guy</Name>
<Address>96 Bullers Parkway</Address>
<Phone>
<daytime>303-555-1414</daytime>
<evening/>
</Phone>
</userInfo>
</users>
would somehow translate to
Table users:
id |userInfo
1 | 1
2 | 2
Table userInfo:
id | Name | address | Phone
1 | first guy | 14 Summer Lane | 1
2 | Second guy | 96 Bullers Parkway | 2
Table Phone
id | daytime | evening
1 | 303-555-1212 | 404-555-1212
2 | 303-555-1414 |
In the most simple of cases like the above it probably wouldn't be too hard to code it up. Ideally the API would be able read the
DTD and code the DB schema from it.
To not leave you totally hanging, try ActiveLink
http://www.active-link.com/intranet/software.php which provides an API into an XML
database which I think would be the hardest part of this project. This API has the advantage that it can be installed anywhere and
you are allowed to re-distribute it.
-CF