|
Posted by NC on 10/13/07 11:36
Jeff D. Hamann wrote:
>
> I've been trying to find a script that can generate an empty (or full)
> database, using sql create statements, from an xml file using php.
Generally speaking, this is something you should avoid. Imagine a
piece of XML that looks like this:
<item>
<species>Cat</species>
<breed>Siamese</breed>
<name>Fluffy</name>
</item>
<item>
<brand>Whiskas</brand>
<description>Cat food</description>
<weight unit="lbs">10</weight>
<package>Bag</package>
</item>
Note that there are two <item> entities, but they contain completely
different data fields. Moreover, XML can contain entities within
entities, whereas databases cannot contain records within records...
This problem can be solved only if the XML structure can be directly
mapped onto a database...
Cheers,
NC
[Back to original message]
|