HTML output from COLLADA instance document

I’m preparing a computer science degree thesis on xml-based 3d formats and I’m focusing on COLLADA. I have to write an application which has to take a .dae file as input and produce as output a HTML document describing in human language the content of the file.
E.g.:
Scene Contents

  • 7 solids
  • 2 cameras
  • 3 lights
    and so on… (just a simplified version)
    I’m writing an xsl stylesheet to do that,but I don’t know how to resolve the default namespace of the collada document. My stylesheet works only if i delete the namespace declaration from the COLLADA document. With the namespace declaration in the document i get only a blank page as a result.
    Can anyone help me?
    Thx

some tools require that you explicitly locate the schema document for a namespace. XMLSpy is one such tool. You cannot validate a document without it.

You do this by using the XMLSchema-instance namespace and the schemaLocation attribute. This would go in the root element, ie. COLLADA

heres an example

<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.collada.org/2005/11/COLLADASchema
C:\SVN\COLLADA_DOM\doc\COLLADASchema.xsd">

What that “says” is that you are using the COLLADA namespace. And then you are using the Schema-instance namespace with the prefix xsi:. then you are using the attribute schemaLocation which is defined in the xsi namespace. The schemaLocation attribute requires two values. The first is the namespace that you want to locate. The second is a path to locate the schema document.

For me I use a local copy of the schema. You can also specify a web address. Look here for more info on that.

You can try this out. It may help, may not.
-Andy

What version of xslt are you using? 1.0? If so if the source document uses a XML schema instead of a DTD then you will need to make sure to use the namespace when selecting nodes. For example, try


<?xml version="1.0"?>
<xsl:stylesheet
 version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:cl="http://www.collada.org/2005/11/COLLADASchema"
 xmlns="http://www.w3.org/1999/xhtml" 
>
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:template match="/cl:COLLADA">

</xsl:template>
</xsl:stylesheet>

your code works,nickmalthus but i don’t know why you add the attribute xmlns=“XHTML namespace”.
Can you suggest me a good tutorial to better comprehend xml namespace-related matter?
is there a w3 official tutorial on xml namespace?
thx for your help