Validating an xml schema

Validation fails, even though the document IS valid and the command line tool xmllint confirms this (even with libxml 2.6.32, so this must be a problem with DOM). Warning: DOMDocument::schema Validate() [domdocument.schemavalidate]: Element 'Your Root Element Name': No matching global declaration available for the validation root.

in on line 40New error message: DOMDocument::schema Validate() Generated Errors!When you want to use a schema to describe an xml document, you basically put the default namespace to a personnal namespace (and you refer to this namespace in the target Namespace attribute of your schema).That xmlns attribute specifies a "default namespace" and means that the root element and its children are in this namespace.It seems that libxml will not automatically try to import referenced schemas, but simply skip the validation if the schemas were not explicitly imported.In our example we tried to validate an XML file against a schema with the namespace "xttp://" that contains a reference to the namespace "xttp://": which basically says that an xhtml-content element can contain any element from the rif-xhtml namespace.

Search for validating an xml schema:

validating an xml schema-25validating an xml schema-89validating an xml schema-55

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “validating an xml schema”