tinyxml2
tinyxml2 copied to clipboard
Mutable visitor
I need a visitor, which allows me to transform some DOM element from one type to another (changing its Name). However the TinyXML2 Visitor provides only const element access.
Is there any specific reason why the elements have to be const aside from the potential use of deleteNode(element)? What else could go wrong if the element is mutable?
I'm not sure what could go wrong; haven't really thought it through. Seems like a tricky approach. Is it possible to change the original DOM or generate a new one?
I prefer to change the existing one for performance reasons. I ended up const_casting the element I want to change. Not the most elegant solution, but probably does no harm..