Game Development Reference
In-Depth Information
Figure 9.11. Using Xpath in XPathBuilder.
against a specific COLLADA document to return specific nodes in the document.
XPath is also available as a query mechanism for many DOM implementations,
such as the .NET implementation used by the XML validator and XML Notepad
applications.
Let's add XPathBuilder [Bubasoft 11] to our toolbox. For example, let's say that
we want to get a list of all the external files used for texturing in a COLLADA docu-
ment. The XPath query is constructed to follow the hierarchy and return all the cor-
responding elements, which in our specific example is /COLLADA/ library_images
/image/init_from (see Figure9.11 ) .
XPathBuilder can be used as an inspection tool or to create queries that then can
be used in a utility application. For instance, using the query from this example,
a small program or script (as most scripting languages have support for XPath)
can be written to create an archive containing a COLLADA document and all its
associated image files.
 
Search WWH ::




Custom Search