Game Development Reference
In-Depth Information
Figure 9.7.
Add coherency test to your path.
/Users/yourname/bin, add the directory to the path using the environment control
panel. Copy the XmlValidator.exe to the bin directory as well (see
Figure 9.7
)
.
Run the coherency test on the duck-err1.dae and duck-err2.dae and look at
the returned errors in Listing 9.2. The coherency test on
duck-err1.dae
returns a
document object nodel (DOM) error, as the file is not a valid XML document. Note
that the C# validator returns the line number for this error, but the coherency test
provides a much better explanation asto what the error is: “Couldn't find end of
Start Tag COLLADA.”
The coherency test on
duck-err2.dae
returns the issue regarding the
cam
child
element, telling us that it is unexpected but should be either
camera
or an
asset
,
but it does not tell us that the parent element is
library_cameras
.Itdoesprovide
a line number [41], but it is approximate. Combining the output of the coherency
test and our XmlValidator can help to locate the errors.
More importantly, the coherency test can detect more errors than our simple
XML validator. The second and third reported errors are basically the same, telling
us that we cannot resolve the element
#cameraShape1
. The coherency test checks
every reference to elements in the document and verifies they exist. Searching
for all the
cameraShape1
content in XML Notepad returns three instances (see
Figure 9.8
)
.