Apparently we are not escaping XML property names for 'typedef-decl',
'namespace-decl' and 'var-decl' elements. I think it's not necessary
for namespace-decl, but well, you never know.
* src/abg-writer.cc (write_namespace_decl, write_typedef_decl)
(write_var_decl): Escape the XML characters that are forbidden in
XML properties, and that are emitted as value of the 'name'
property.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
do_indent(o, indent);
- o << "<namespace-decl name='" << decl->get_name() << "'>";
+ o << "<namespace-decl name='"
+ << xml::escape_xml_string(decl->get_name())
+ << "'>";
typedef scope_decl::declarations declarations;
typedef declarations::const_iterator const_iterator;
do_indent(o, indent);
- o << "<typedef-decl name='" << decl->get_name() << "'";
+ o << "<typedef-decl name='"
+ << xml::escape_xml_string(decl->get_name())
+ << "'";
o << " type-id='" << ctxt.get_id_for_type(decl->get_underlying_type()) << "'";
do_indent(o, indent);
- o << "<var-decl name='" << decl->get_name() << "'";
+ o << "<var-decl name='" << xml::escape_xml_string(decl->get_name()) << "'";
o << " type-id='" << ctxt.get_id_for_type(decl->get_type()) << "'";
if (write_linkage_name)