Hello everybody...
I'm building an app that connects with the ebay API. The XML must validate against a provided schema (which I have downloaded to my local server). Here is the code in question:
$requestXmlBody = '<?xml version="1.0" encoding="utf-8" ?>';
$requestXmlBody .= '<GeteBayOfficialTimeRequest xmlns="urn:ebay:apis:eBLBaseComponents">';
$requestXmlBody .= "<RequesterCredentials><eBayAuthToken>$userToken</eBayAuthToken></RequesterCredentials>";
$requestXmlBody .= '</GeteBayOfficialTimeRequest>';
$requestDoc = new DOMDocument();
$requestDoc->loadXML($requestXmlBody);
if (!file_exists("../ebay_schema.xml")) {
die("Schema File is missing");
}
if (!$requestDoc->schemaValidate("../ebay_schema.xml"))
{
echo "not";
print_r(libxml_get_errors(), 1);
die();
}
When I run this, all I get is "not". First of all, is this the best way to validate an XML schema? if not what is? if so, if there are errors, why isn't libxml_get_errors() returning anything?