Opened 8 years ago

#10810 new Bugs

Property tree XML parser eats whitespace of text elements

Reported by: ahaferburg@… Owned by: Sebastian Redl
Milestone: To Be Determined Component: property_tree
Version: Boost 1.41.0 Severity: Problem
Keywords: Cc:

Description

The trim_whitespace flag converts this XML:

<yes>

  <sadly>Whitespace matters </sadly>
</yes>

into this:

<yes>
  <sadly>Whitespace matters</sadly>
</yes>

While the deletion of whitespace in elements that contain other elements is fine, I would consider it a bug to delete whitespace in elements that contain only text. It wouldn't do this to attributes, so it shouldn't do it to text elements.

I believe that the cause is that the boost version of rapidxml combines the two flags parse_trim_whitespace and parse_normalize_whitespace into one, trim_whitespace.

Change History (0)

Note: See TracTickets for help on using tickets.