I have an XML that is not valid, there are many problems in the file itself, and I need to do daily reimports from that file. The structure looks like this:
<products>
<product no="AP1222-00" name="Colours kravata" price="456" currency="Kč">
<description name="POPIS PRODUKTU">Kravata Premier Line v moderních barvách. Materiál polyester. Baleno v sáčku s černým poutkem.</description>
</product>
<product no="AP1222-22" name="Colours kravata" price="330" currency="Kč">
<description name="POPIS PRODUKTU">Blabla.</description>
</product>
</products>
Is there any easy way to get the array of products, so I can fix the problems in the files before importing it? SimpleXML
etc. don't work, as the file is invalid.
Edit: Here's one complete products of the XML for reference, notice the double quotes in product name:
<products>
<product no="AP1222-00" name="" Colours" kravata" price="456" currency="Kč">
<folders>
<folder category="<b>COOL 2017</b>" subcategory="TEXTILE & FASHION"/>
<folder category="TEXTILE & FASHION" subcategory="Kravaty a šály"/>
</folders>
<description name="POPIS PRODUKTU">Kravata Premier Line v moderních barvách. Materiál polyester. Baleno v sáčku s
černým poutkem.
</description>
<properties>
<property name="KS / KARTON" value="100"/>
<property name="HMOTNOST KARTONU" value="6"/>
<property name="NETTO HMOTNOST / KARTON" value="5"/>
<property name="DIM1" value="15"/>
<property name="DIM2" value="80"/>
<property name="DIM3" value="35"/>
<property name="TECHNOLIGIE POTISKU" value="T1 (8C, 50×80 MM)"/>
<property name="TARIF" value="6215200090"/>
<property name="Min. mn. (ks)" value=""/>
<property name="M3/CARTON" value="0.042"/>
<property name="COOL 2017 KAPITOLA" value="TEXTILE AND FASHION"/>
<property name="COOL 2017 STRANY" value="525"/>
<property name="main category" value="fashion"/>
</properties>
<images>
<image src="http://www.andapresent.com/kepek/cms/original/83653.jpg"/>
</images>
<stocks>
<stock name="navi_central" value="2"/>
<stock name="navi_arrive" value="" date=""/>
<stock name="eu_central" value="" date=""/>
<stock name="eu_arrive_1" value="" date=""/>
<stock name="eu_arive_2" value="" date=""/>
</stocks>
</product>
</products>