Trim whitespace in rapidxml parser text nodes.
The libxml parser already trims text nodes, which leads to a difference in behaviour when reading map style XML. This patch normalises the behaviour between the two.
This commit is contained in:
parent
8e1e5f19d1
commit
5616d406b4
1 changed files with 5 additions and 1 deletions
|
@ -138,7 +138,11 @@ private:
|
|||
{
|
||||
if (cur_node->value_size() > 0) // Don't add empty text nodes
|
||||
{
|
||||
node.add_child(cur_node->value(), 0, true);
|
||||
// parsed text values should have leading and trailing
|
||||
// whitespace trimmed.
|
||||
std::string trimmed = cur_node->value();
|
||||
mapnik::util::trim(trimmed);
|
||||
node.add_child(trimmed.c_str(), 0, true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue