Hi Robert,

An ATOM is an xml node that has no children or contents - it's just a
< tag properties=".." />

Well, this is exactly the type of tag I had and that the original XmlReader failed to read...

Looking over the read code, it seems it doesn't set the node type to ATOM anywhere. So perhaps I just need to set this type at the appropriate place and then drop the changes I made to the write code altogether.

Let me rework my changes and I'll get back to you.

On a related subject, would you be opposed to a validate() method that would be called by the write() method (before any writing occurs) and would traverse and set the appropriate types? For example, a node that has no children or contents would be set to ATOM, one with contents but no children to NODE, and one with children to GROUP. It seems to me that it's too easy for a user to add a child to an ATOM but forget to change the type to GROUP, and then on write the children will not be written.

A better idea would be to make the data members protected and add some methods like addChild(...) and so on so that this validation can happen at that time. But I can appreciate your desire to keep those classes simple.

Thanks,

J-S
--
______________________________________________________
Jean-Sebastien Guay    [email protected]
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to