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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.