|  | Posted by NC on 06/13/19 11:29 
Jorge A wrote:>
 > I'm trying to create a database from a XML, but I don't really know
 > how to do it.
 
 It gets worse; there is no guarantee that a well-designed database
 can be created from a given XML.  Imaging 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.  Obviously, this example is extreme, but
 it is possible you will encounter dissimilarities between data
 structures across same-level entities...
 
 > I'm pretty new with PHP and MySQL. Could anyone help me and explain
 > how it works?? Is there a best way to parse a XML into MySQL db??
 
 First, you must understand what data XML is conveying and determine
 the structure of the target database...
 
 Cheers,
 NC
 [Back to original message] |