I have an XSD (XML Schema) which contains multiple files. There's a catalog.xml in the root of the system, which is an XML Catalog. It contains SYSTEM and URI catalog definitions which are needed to use to properly process the xsd files.
Now my question: How can I validate xml against these schemas in php? If I simply use DOMDocument->Schemavalidate() and give it the correct xsd, the catalog definitions will not be resolved, and the php throws an error like this:
Warning: DOMDocument::schemaValidate(): I/O warning : failed to load external entity "urn:oasis:names:tc:dita:xsd:highlightDomain.xsd:1.2"
It's in the catalog.xml how to resolve this expression, but I couldn't find a way to handle that with php.
DOM uses libxml underneath. LibXML should be able to use Catalog files when they are placed in /etc/xml/catalog
. Same path on windows IIRC.
Feel free to upvote my feature request to make the path configurable from PHP: