Well I am using the below script to load XML file, but it gives me errors:
$document = new DomDocument;
$document->load("xml/products_categories.xml");
//error: [09-Oct-2015 02:35:31 UTC] PHP Warning: DOMDocument::load(): Opening and ending tag mismatch: subcatetory line 4...
<?xml version="1.0"?>
<categories>
<category id="1" value="Books">
<subcatetory id="1">Audio</subcategory>
<subcatetory id="2">Children</subcategory>
<subcatetory id="3">Fiction</subcategory>
<subcatetory id="4">Magazines</subcategory>
<subcatetory id="5">Programming</subcategory>
<subcatetory id="6">Spiritual</subcategory>
<subcatetory id="7">Technology</subcategory>
<subcatetory id="8">Textbooks</subcategory>
</category>
<category id="2" value="Clothing & Shoes">
<subcatetory id="1">Babies</subcategory>
<subcatetory id="2">Boys</subcategory>
<subcatetory id="3">Girls</subcategory>
<subcatetory id="4">Men</subcategory>
<subcatetory id="5">Women</subcategory>
</category>
<category id="3" value="Games">
<subcatetory id="1">Video Games</subcategory>
<subcatetory id="2">Digital Games</subcategory>
</category>
</categories>
I checked the syntax of XML and it seems perfect valid for me, but why do I get XML parsing error? Maybe PHP’s XML parser doesnt work properly? Or am I missing something?