Th3Ya0vi / pugixml

Automatically exported from code.google.com/p/pugixml
0 stars 0 forks source link

Special characters in XML structure #198

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hello. I need some special characters in XML-structure: "<" and ">".
But this easy code doesn't works properly for me:

const char *xml = "<anything>&lt</anything>";
pugi::xml_document doc;
doc.load_buffer(xml, strlen(xml));
pugi::xml_node node = doc.child("anything");
cout << node.text().get() << endl;

I have "&lt" in output.
Next variants don't work also:

//const char *xml = "<anything>&#x003C</anything>";
//doc.load_buffer(xml, strlen(xml), pugi::parse_default & ~pugi::parse_escapes);
//doc.load_buffer(xml, strlen(xml), pugi::parse_default | pugi::parse_escapes);

Is there any way to having special characters in XML structure?

Original issue reported on code.google.com by egoch...@gmail.com on 26 Feb 2013 at 10:19

GoogleCodeExporter commented 8 years ago
Sorry, I forgot the important symbol ";" in my XML-structure:
"<" -> "<"

After this easy manipulation the code works fine :)

Original comment by egoch...@gmail.com on 26 Feb 2013 at 10:46

GoogleCodeExporter commented 8 years ago

Original comment by arseny.k...@gmail.com on 3 Mar 2013 at 2:58