Hi,
I’m using DHtmlXTree LodXml feture and after that I’m trying to save the tree state into a cookie. The code looks something like this:
// Tree creation …
var xml = ‘<![CDATA[ any test]]>’;
tree.loadXMLString(xml);
tree.saveState(“stateCookie”);
// … And after that
tree.loadState(“stateCookie”);
It appears that the tree is not loaded correctly. I think this is because the saveStatemethod uses serializeTree which does not deal with CDATA correctly (the item’s text is always serialized as a XML attribute).
Are my observations correct and How can I save and load the state of a tree with CDATA in the items’s text?
Thanks in advance.
Regards,
Atanas
Are my observations correct and How can I save and load the state of a tree with CDATA in the items’s text?
Yes, during serialization,tree always use XML attribute for text storing, so it is not possible to use CDATA section, but you can use auto-escaping, which will allow to store complex content in XML attributes
tree.setSerializationLevel(false,false,true)