Game Development Reference
In-Depth Information
This modified version of XML Notepad can now validate .dae documents, and
provide dynamic help in the status bar that displays the comment in the COLLADA
schemacorrespondingtotheelementselectedinthetreeview;see Figure9.10 .
Alternatively, the xml.xsd schema can be saved locally, so XML Notepad will
not require an internet connection to execute. We can further modify the code to
automatically load both the XSD and COLLADA schema to turn XML Notepad
into a COLLADA editing/validation tool that can execute without an internet
connection:
// hack to force application to validate with local copy
// of COLLADA schema
try
{
string appPath = Directory.GetCurrentDirectory();
set . Add ( " http: // www . w3 . org / XML /1998/ namespace " ,
appPath + "/xml.xsd");
set . Add ( " http: // www . collada . org /2005/11/ COLLADASchema " ,
appPath + "/collada_schema_1_4.xsd");
} catch
{
Console.WriteLine("Cannot find xml.xmd or
collada_schema_1_4.xsd" );
}
9.7 Unique ID, Name versus ID
The ID of an element in a COLLADA document has to be unique, as this is the
information that is used to precisely identity an element in the document. A COL-
LADA document that contains several elements with the same ID can cause all
kinds of problems, including application crashes. Note that the ID uniqueness
is only requested within one document, as it is easy to create a unique ID out-
side of a document by appending the document name to the element ID (e.g.,
duck.dae#cameraShape1 and pig.dae#cameraShape1 aretwouniqueIDs). The
coherency test checks for uniqueness of IDs, and it is recommended to always fix
unique ID issues before going further in investigating issues with a COLLADA
document.
For example, here's an issue reported by the coherency test related to unique
IDs:
>coherencytest Xintiandi.dae
ERROR: Unique ID conflict id=_301_HB05_02_jpg ,
docURI=file:/F:/..../ Xintiandi.dae
ERROR: Unique ID conflict ....
Search WWH ::




Custom Search