i’m using xml for saving documents. since my documents can be edited with a simple text editor, i wonder why some characters are escaped with longs xml entities even inside a string attribute. i mean, if i set an attribute of a node to be a file path, instead of ‘’ or ‘/’ there are something like a lot of ‘& # 9 2 ;’ which is correct, but makes my xml unreadable and not easily updatable from external editor. there is a way to prevent the XmlDocument to not perform conversion of characters to their corrispective entities values ?
Isn’t that correct according to the xml spec for the language set you specified? Try a Unicode set (can juce save as different language sets?) instead?
yes, should be like this. anyway changing the encoding when writing the xml structure to file, in juce, it just only change the top xml definition encoding, but it don’t deal with each character encoding. in fact looking in the sources, i just see it doing escapeIllegalXmlCharacters for all not allowed characters regardless of the specified encoding (and also opening the file from an editor… whatever encoding you specify, it is always recognized as plain ansi).
Ah, makes sense. I guess if you need to do something more major using XML, maybe use tinyxml or something…
It’s only a case of adding the \ character to the list of legal xml chars in XmlElement.cpp.
I notice that the forward slash is already in there, I probably just forgot to add the back slash. It is a legal character, so should be in there too.
thanx for the support