Game Development Reference
In-Depth Information
Once compiled, the executable can be invoked using the command line (
cmd
):
>ValidateXml.exe
Usage XmlValidate document.dae
>ValidateXml.exe duck.dae
Document is valid
Let's test the validator, first, by making the document invalid for basic XML
parsing. The document
duck-err1.dae
has a missing
>
at the end of the
<COLLADA
definition
< COLLADA xmlns = "
http :// www . collada . org /2005/11/ COLLADASchema
"
version="1.4.1"
Let's run the validator on this file:
>ValidateXml.exe duck-err1.dae
[XML error] Name cannot begin with the
<
character,
hexadecimal value 0x3C. Line 3, position 5.
Document is invalid
Then let's check if the validator can detect COLLADA schema issues in a valid
XML document. For example, the document
duck-err2.dae
is using
cam
instead
of
camera
. The COLLADA schema says that only
camera
and asset child ele-
ments can be used at this position in the object hierarchy, as a child element of
library_cameras
. The document is a valid XML document, but it does not respect
the rules that make it a COLLADA document:
>ValidateXml.exe duck-err2.dae
[Validation error] The element
library_cameras
in namespace
has invalid child
element
cam
in namespace
List of possible elements expected:
asset, camera
in namespace
Document is invalid