I have searched everywhere for an answer to this but cannot seem to find one.
I am trying to validate an XML file against an XSD file. I have so far written this.
$x_validate = new DOMDocument();
$x_validate->load($xml_path);
$x_validate->schemaValidate($xsd_path);
At first the paths were set to a remote location. I then realised that these remote files require authentication to be seen. So to avoid this I downloaded the files into my directory so the paths were like the following.
$xml_path = "./test-v1.xml";
$xsd_path = "./test-v1.xsd";
The only problem with this is that it didn't work and I got some errors. One of them being this. I blanked out the URL for security purposes.
Warning: DOMDocument::schemaValidate() [domdocument.schemavalidate]: Element '{http://www.w3.org/2001/XMLSchema}include': Failed to load the document 'https://****' for inclusion. in C:\Xampp\htdocs\cdes\xml-validation\run-validation.php on line 15
So because of this error I am back to my original remote referencing of the URL.
Can someone please point me in the right direction to send the authentication username and password to the XSD and XML file before validating the schema?
Thank you.