Esempio n. 1
0
 public function testGenericXinclude()
 {
     $type_schema_path = __DIR__ . DIRECTORY_SEPARATOR . 'Fixtures' . DIRECTORY_SEPARATOR . 'extensive_type_schema_include.xml';
     $document = new Document('1.0', 'utf-8');
     $document->load($type_schema_path);
     $document->xinclude();
     $xpath = new Xpath($document);
     $xml_base_nodes = $xpath->query('//@xml:base', $document);
     $this->assertEquals(0, $xml_base_nodes->length);
 }
 protected function createDomDocument($type_schema_file)
 {
     if (!is_readable($type_schema_file)) {
         throw new FileSystemException("Unable to read file at path '{$type_schema_file}'.");
     }
     // @todo more xml error handling
     $document = new Document('1.0', 'utf-8');
     if (!$document->load($type_schema_file)) {
         throw new ParseException("Failed loading the given type-schema.");
     }
     $document->xinclude();
     if (!$document->schemaValidate($this->xsd_schema_file)) {
         throw new ParseException("Schema validation for the given type-schema failed.");
     }
     return $document;
 }