Schema validation: Difference between revisions

From COLLADA Public Wiki
Jump to navigation Jump to search
SteveT (talk | contribs)
No edit summary
 
SteveT (talk | contribs)
No edit summary
Line 1: Line 1:
Stub for schema validation article.
The COLLADA format is defined by a W3C schema. If a document doesn't conform to the schema then it isn't valid COLLADA data. This tutorial explains a few different ways to validate a COLLADA document against the schema.
 
==Using xmllint==
xmllint is a command-line application that can be used to validate an XML document against a W3C schema. xmllint is distributed as part of [http://xmlsoft.org/ libxml]. You can find binaries for Windows [http://www.zlatkovic.com/libxml.en.html here]. Most Linux distributions come with libxml already installed.
 
To validate the file duck.dae against the latest COLLADA 1.4.1 schema available from Khronos, run the following command:
xmllint --noout --schema http://www.khronos.org/files/collada_schema_1_4 duck.dae
 
You could also copy the schema locally and use your local version:
xmllint --noout --schema colladaSchema.xsd duck.dae
 
The <code>--noout</code> option prevents superfluous output. If the COLLADA document violates the schema, xmllint will print an error message.


[[Category:Tutorials]]
[[Category:Tutorials]]

Revision as of 03:06, 25 May 2007

The COLLADA format is defined by a W3C schema. If a document doesn't conform to the schema then it isn't valid COLLADA data. This tutorial explains a few different ways to validate a COLLADA document against the schema.

Using xmllint

xmllint is a command-line application that can be used to validate an XML document against a W3C schema. xmllint is distributed as part of libxml. You can find binaries for Windows here. Most Linux distributions come with libxml already installed.

To validate the file duck.dae against the latest COLLADA 1.4.1 schema available from Khronos, run the following command:

xmllint --noout --schema http://www.khronos.org/files/collada_schema_1_4 duck.dae

You could also copy the schema locally and use your local version:

xmllint --noout --schema colladaSchema.xsd duck.dae

The --noout option prevents superfluous output. If the COLLADA document violates the schema, xmllint will print an error message.