Saving document

Hi,

after loding and modifing a COLLADA document i try to save this document and all COLLADA attributes (e.g. xmlns:xsi=“…” xmlns:math=“…”) disappear.

It keeps only the two attributs:

i tried dae.save(…), dae.write(…), dae.writeTo(…), dae.writeAll(…).

Is there a way to save the modified document with all attributes of the COLLADA element?

Thanks.

What library version are you using?

I m using colladadom 2.2.

The COLLADA schema declares three valid attributes for the <COLLADA> element: xmlns, version, and xml:base. According to XML and XML Schema language, element attributes must be declared in the schema in order to be valid in an instance document (i.e. a .dae file).

The DOM is code generated from the COLLADA schema and therefore only reads and writes valid documents. Adding more attributes like you are trying to do would produce an invalid document.

I hope that answers your question.

In this case, how would a valid COLLADa 1.5 document including mathml (and its namespace) look like ?

domFormula* formula = …
if(formula)
{
formula->setId(id.c_str());
formula->setNSUri(“MathML Namespace”);

}
Now the MathML Elements can be attached - don’t forget to set the “mathml:” prefix.
Patch for current DOM attached

Thank you! Will the patch be included in the next release of colladadom?