Closed GoogleCodeExporter closed 9 years ago
You have two options.
1. Change the class field type to const char_t*
2. Violate const-correctness by casting: char_t* c =
const_cast<char_t*>(node.child_value()).
Note that actually changing data that the pointer c points to will work (it
will change the value of a PCDATA node in the document), but is not defined
(i.e. no guarantee that a future version of pugixml will not break this). Also,
obviously, trying to increase the size of the value will lead to more undefined
behavior (i.e. writing more bytes to c than the value of strlen(c)).
If you want a supported way to change the child value, you can do
node.text().set("...");
Original comment by arseny.k...@gmail.com
on 14 Oct 2012 at 10:47
Original issue reported on code.google.com by
fmichel....@gmail.com
on 14 Oct 2012 at 1:00