Jump to content

Validate Using Schemas with Depedencies


invertrio

Recommended Posts

Hello everyone!

 

I am trying to validate a batch of XML documents by using DOMDocuments' schemaValidateSource() method.

 

Unfortunately I receive the following error messages when I actually do the validation:

 

PHP Warning:  DOMDocument::schemaValidateSource(): I/O warning : failed to load external entity "ncbi-mathml2/mathml2.xsd" in C:\path\to\Validate.php on line 90
PHP Warning:  DOMDocument::schemaValidateSource(): Element '{http://www.w3.org/2001/XMLSchema}import': Failed to locate a schema at location 'ncbi-mathml2/mathml2.xsd'. Skipping the import. in C:\path\to\Validate.php on line 90
PHP Warning:  DOMDocument::schemaValidateSource(): I/O warning : failed to load external entity "xlink.xsd" in C:\path\to\Validate.php on line 90
PHP Warning:  DOMDocument::schemaValidateSource(): Element '{http://www.w3.org/2001/XMLSchema}import': Failed to locate a schema at location 'xlink.xsd'. Skipping the import. in C:\path\to\Validate.php on line 90
PHP Warning:  DOMDocument::schemaValidateSource(): I/O warning : failed to load external entity "xml.xsd" in C:\path\to\Validate.php on line 90

 

Is there anyway to resolve this issue without hard coding paths into the schemas themselves?

 

I was hoping that there would be some property I could set so that when DOMDocument looks for dependencies, it will check a different directory.

Link to comment
https://forums.phpfreaks.com/topic/137456-validate-using-schemas-with-depedencies/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.