Closed GoogleCodeExporter closed 9 years ago
The problem is acknowledged.
There are several possible ways to fix that - I see three possible solutions:
- (optionally) switch to raw mode conditionally (one can do it for the
immediate children or, as you do it, for the whole subtree)
- (optionally) trim the leftmost/rightmost whitespaces from PCDATA contents at
saving time
- (optionally) trim the leftmost/rightmost whitespaces from PCDATA contents at
parsing time - long ago there was a flag that did that, parse_trim_pcdata
Personally, I prefer the last approach - it seems cleaner to me, and it's even
possible that it's a good default - thought that's a breaking change, obviously
- because people very rarely view the indentation whitespace as significant.
I'll look into the three approaches more closely, one of them will be
implemented in the next version.
Original comment by arseny.k...@gmail.com
on 26 Nov 2010 at 8:48
Original comment by arseny.k...@gmail.com
on 9 Feb 2014 at 12:49
Original comment by arseny.k...@gmail.com
on 9 Feb 2014 at 12:49
Note: it is now possible to use parse_trim_pcdata flag to work around the issue.
I still plan to change the auto indenter to guarantee that the amount of
whitespace in PCDATA does not grow during parse/save cycle; this should happen
in v1.5.
Original comment by arseny.k...@gmail.com
on 28 Feb 2014 at 6:50
Moving this issue to GitHub: https://github.com/zeux/pugixml/issues/13
Original comment by arseny.k...@gmail.com
on 26 Oct 2014 at 8:54
Original issue reported on code.google.com by
gordon.k...@gmail.com
on 25 Nov 2010 at 2:14