i'm storing a var as json which then becomes an xml element. I have noticed that in the XML any quotation marks are escaped with """. As far as i can tell it shouldn't be nessecary.
Am i wrong? is there a way to prevent the escaped quotations marks. Below is a test prog and the output.
int main (int argc, char* argv)
ScopedPointer<XmlElement> e = new XmlElement ("TEST");
e->setAttribute ("foo", "bar");
var varThings = "hello world";
XmlElement* things = new XmlElement ("SUB");
things->addTextElement (JSON::toString(varThings, false));
<?xml version="1.0" encoding="UTF-8"?>
They may not be strictly necessary, but it is legal XML.. If you wanted to make sure by checking the XML spec as to whether there really can be a quote there, and suggest a code change to avoid it, I'd be open to the idea :)
I also encountered the same "problem".
I would save the javacript in my xml.
One solution would be to use a section "CDATA" but does XmlDocument class manages the reading and not writing.
Do you have a solution?
if (a < b && a < 0) then
TBH I'm unclear about why you're even flagging this as a problem? The juce code produces legal XML, and any compliant parser should deal with it correctly, right?
The term CDATA is used about
I was actually replying to olilarkin, not to Guillaume.
But re: CDATA, I'm not opposed to doing that, but am not sure how it could easily be added without bloating the XmlElement class.
Thank you to Rebbur. It express exactly what I wanted dir. Sorry for my english
i'm just interested in making my application's file format as human readable as possible, and not bloating it with gazillions of """s . i thought there might be a way.
Understood, and yes, it could probably be done - bit of a low priority for me, but happy to accept change suggestions if you want to have a go!