I have a XML file and a a bunch of XSD files with schemas. How do I parse the XML file using the correct XSD file and schema in PHP?
2 Answers
You can use the DOM or XmlReader extensions
DOMDocument::schemaValidate— Validates a document based on a schemaXMLReader::setSchema— Validate document against XSD
to validate documents against a schema.
Comments
Check this tool - http://github.com/moyarada/XSD-to-PHP. It sounds exactly what you're asking. You can marshal/unmarshal XML usind generated from XSD PHP classes.
2 Comments
Padraig
Good idea but how do I drive this thing? ;) No use cases or examples.
William Kinaan
Yes the problem is this library is lack of documentation