rdiankov / collada-dom

COLLADA Document Object Model (DOM) C++ Library
78 stars 40 forks source link

domNode->getAttribute returns strings cut by whitespace #35

Closed unelsson closed 3 years ago

unelsson commented 3 years ago

This is a duplicate of https://sourceforge.net/p/collada-dom/bugs/160/

domNode->getAttribute returns strings cut by the first whitespace, this prevents naming bones with whitespaces, e.g name="Left Hand" will be returned only as "Left".

This happens when using OpenSceneGraph, the code calling domNode is at https://github.com/openscenegraph/OpenSceneGraph/blob/OpenSceneGraph-3.6/src/osgPlugins/dae/daeRSkinning.cpp#L258 .

I also filed a bug against OSG, but I believe the issue currently lies at ColladaDOM. https://github.com/openscenegraph/OpenSceneGraph/issues/1016

AnyOldName3 commented 3 years ago

Some more clarification to show that we think we actually do know what we're doing, rather than just being surprised by correct behaviour:

According to the Collada schema, bone names have type xs:token, which we understand to be a string where all whitespace has been replaced by a single space per occurrence as backed up by https://www.oreilly.com/library/view/xml-schema/0596002521/re95.html.

A concrete example of a snippet we think is being misparsed is <node id="root" sid="id-skelbones-2-0" name="Bip01 Right Hand" type="JOINT">, where we're getting "Bip01" when querying the name, but expect "Bip01 Right Hand".

RemiArnaud commented 3 years ago

That is one of the main difference between 1.4 and 1.5

1.4 -> NCName 1.5 -> token

unelsson commented 3 years ago

That is one of the main difference between 1.4 and 1.5

1.4 -> NCName 1.5 -> token

Ah, and NCName doesn't support whitespaces... It makes sense, I'll check the pipeline, and OSG's collada plugin to confirm it's the case here.

unelsson commented 3 years ago

OSG supports only collada spec 1.4.1, so I'm closing this issue here.

Thank you @RemiArnaud and @AnyOldName3 !