reading <extra> content

Hi folks, I’m using Collada DOM trying to read the information from the <extra> tags e.g. below:

<node id="iBillboardObject_oak2_bill" name="iBillboardObject_oak2_bill">
   <translate sid="translate">713.030 17.719 569.393</translate>
   <rotate sid="rotateX">1.0 0.0 0.0 0.000</rotate>
   <rotate sid="rotateY">0.0 1.0 0.0 0.000</rotate>
   <rotate sid="rotateZ">0.0 0.0 1.0 0.000</rotate>
   <scale sid="scale">0.409 0.409 0.409</scale>
      <technique profile="BILLBOARD_INSTANCE">
         <param faceCamera="True" height="35" radius="17.5" numFaces="1" xmlns="">
            <faceSurface colladaID="mat_BillboardMaterial9" />

I can get to the element, but can’t figure out how to read any further. The code below gets me to the technique element:

domExtraRef ex = extras.get(i);
if (ex!=NULL) 
	domTechnique_Array techs = ex->getTechnique_array();
	for (int j=0; j<techs.getCount(); j++) {
		domTechniqueRef tech = techs.get(j);
		if (tech!=NULL) {
			daeString profile = tech->getProfile();
			if (strcmp(strlwr((char*)profile), "billboard_instance") == 0) {
				//billboard instance

Am I missing something obvious? tech-> ???


The getContents() method on the technique will get you all the child xml elements of the technique as daeElement objects, then you can cast the daeElement to domAny, which has all the information you need.

Have you run that through an XML validator?

There may be an issue with that extra block. The way COLLADA allows for anyXML it still allows for strongly typed COLLADA elements. The fact that you use an element named <param> but it has different attributes and children than the COLLADA <param> might be ambiguous or invalid. It’s been a while since I’ve looked at the XML Schema specification about what would happen here but I think it’s invalid. And as the lead programmer of the DOM, and the designer/implementor of how the DOM handles anyXML, I really believe that isn’t going to work in the DOM. The DOM is going to see the <param> and try to create a domParam object. Then the attributes will fail and so will adding the child.

When you load this into the DOM does it send warning messages to stdout about invalid attributes and elements?

Also as a style point, the BILLBOARD_INSTANCE would work better as the extra’s type attribute. The technique’s profile attribute is supposed to differentiate between different tools/venders. The way it is there isn’t necessarily wrong, just against convention.


Ok, I’ve reorganised things a little:

<extra type="avatarInstance">
   <technique profile="myColladaExporter">
      <arpSettings arpFile="characters\fred.arp" mtnFile="" texture="skin.tga" feetOnGround="False" xmlns="" />

No more schema warnings except for the attributes within the <arpSettings> element- I assume I can safely ignore these, and the warnings about the xmlns attributes that are absolutely everywhere in the .dae files I get from .NET’s XML code?