Ticket #4840: boost_property_tree_attribute_encoding_quote.patch

File boost_property_tree_attribute_encoding_quote.patch, 1.1 KB (added by Rene Heinzl <heinzl@…>, 12 years ago)
  • boost/property_tree/detail/xml_parser_write.hpp

     
    8888                }
    8989            }
    9090        }
     91
     92
    9193       
    9294        // Write element
    9395        if (pt.data().empty() && pt.empty())    // Empty key
     
    116118                if (optional<const Ptree &> attribs = pt.get_child_optional(xmlattr<Ch>()))
    117119                    for (It it = attribs.get().begin(); it != attribs.get().end(); ++it)
    118120                        stream << Ch(' ') << it->first << Ch('=') <<
    119                                   Ch('"') << it->second.template get_value<std::basic_string<Ch> >() << Ch('"');
     121                                  Ch('"') << encode_char_entities(
     122                                                                   it->second.template get_value<std::basic_string<Ch> >()
     123                                  )  << Ch('"');
    120124
     125
     126
    121127                if ( has_attrs_only )
    122128                {
    123129                    // Write closing brace