I am using Xerces library, everything is fine to use but now I want to escape the XML string and I found there is a XMLFormatter clas开发者_如何学Cs used for that, after I dig into the doc, I see it is really hard to use from the constructor perspective. What I want is just 2 functions:
string escape(string);
string unescape(string);
why xerces makes this so hard to do?
What you're trying to do isn't really related to the XML itself. If you were to store the XML to a file then this wouldn't be necessary. Ditto if you were sending over a network connection using just TPC or UDP. I assume you want to send it over HTTP, and this is really something I would expect to see as a function of whatever library you're using to do your HTTP communication. Do you expect to see functions to escape for MySQL, MS SQL, Oracle, JSON?
精彩评论