evdawg80 Posted March 24, 2008 Share Posted March 24, 2008 Stuck. Is this even possible? I'm trying to figure out a way for someone to upload an xml file via a PHP upload form and have the script run through the XML file and look for errors and spit them out (if any). Basically, there will be items in the xml file like terms, inception date, etc. An example of an error would be if the terms are over 84, then one of the errors should say, "Term over 84" and so on. Link to comment https://forums.phpfreaks.com/topic/97662-validate-xml-from-post/ Share on other sites More sharing options...
rhodesa Posted March 24, 2008 Share Posted March 24, 2008 You have three options. 1) Manually do it (big pain) 2) XSD (my preference) 3) DTD (second choice) XSD Here is how to write a XSD Doc: http://www.w3schools.com/schema/ Then use DOMDocument->schemaValidate() Check out this comment in particular: http://us2.php.net/manual/en/function.dom-domdocument-schemavalidate.php#62032 DTD Here is how to write a DTD Doc: http://www.w3schools.com/dtd/ Add the DTD reference to the uploaded XML file Then use DOMDocument->validate() Link to comment https://forums.phpfreaks.com/topic/97662-validate-xml-from-post/#findComment-499707 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.