views:

20

answers:

0

Hello!

I have a problem validating a given XML file in PHP. This works with a given $myFile xsi schema:

function validate($file){
    $xsi = $myFile;
    if(@!$this->dom->schemaValidate($xsi)){
        $warning = error_get_last();
        throw new Exception ('XML validation of file "'.$this->file.'" failed: '.$warning['message']);
    }
}

But how can I use the referenced schema from the xml file?

<?xml version="1.0" encoding="UTF-8"?>

<item xsi:noNamespaceSchemaLocation="http://my.server.com/schema.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;

Thank you for your help.