We get XML files from different vendors that contains the same basic info we need, but their tag formatting may be different. We want to save a template for each vendor that should allow us to check whether they're formatting their file properly so that we don't insert erroneous data.
I'm using SimpleXML to parse their file, and I've stripped down their last file to its basic tags, attributes, and datatypes, so it looks like this:
<shipment>
<orderNo>int</orderNo>
<orderDate>yyyymmdd</orderDate>
<custRef>varchar</custRef>
<carton>
<ctnNo>int</ctnNo>
<items>
<item color="varchar" description="varchar" size="varchar" style="int" unitPrice="double">
<quantity>int</quantity>
<price>double</price>
</item>
</items>
<ctnWeight>int</ctnWeight>
<ctnPrice>double</ctnPrice>
</carton>
<shipmentWeight>int</shipmentWeight>
</shipment>
Is anyone aware of a PHP validator that can cross-check the tag heirarchy etc?
Validating an XML file using a template
Moderator: General Moderators