PHP Classes

file.xml

Recommend this page to a friend!

      MySQL DB Schema to XML and XML to Schema  >  All threads  >  file.xml  >  (Un) Subscribe thread alerts  
Subject:file.xml
Summary:Is the .xml file required to have specific structure?
Messages:2
Author:Adam
Date:2010-02-27 13:46:22
Update:2011-07-14 11:13:55
 

  1. file.xml   Reply   Report abuse  
Picture of Adam Adam - 2010-02-27 13:46:22
I have the following xml
<Catalog>
<Site>
<Category><![CDATA[General]]></Category>
<Id>IDFORSITE</Id>
<Title><![CDATA[A title here.]]></Title>
<Description><![CDATA[A description here]]></Description>
<Gravity>2.48287</Gravity>
<PercentPerSale>75.0</PercentPerSale>
<ActivateDate>2010-02-06</ActivateDate>
</Site>
<Site>
.... etc
</Site>
</Catalog>

but this class fails here:
$xml_tbl_struct = $xml_tbl->getElementsByTagName("structure")->item(0)->nodeValue;

with this error:
Trying to get property of non-object in /path/to/mysql_db_xml_2_schema.php

  2. Re: file.xml   Reply   Report abuse  
Picture of Tofeeq ur Rehman Tofeeq ur Rehman - 2011-07-14 11:13:55 - In reply to message 1 from Adam
your xml should be contained in "structure" tag like
<structure>
...
</structure>