Fix incorrect xml escaping in base class name when base class is a template

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7362 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2005-08-14 21:20:40 +00:00
parent c061a4f160
commit f74c045cca
1 changed files with 16 additions and 1 deletions

View File

@ -275,13 +275,28 @@ public:
for (s = First(p); s.item; s = Next(s))
{
print_indent(0);
Printf( out, "<base name=\"%s\" id=\"%ld\" addr=\"%x\" />\n", s.item, ++id, s.item );
String *item_name = Xml_escape_string(s.item);
Printf( out, "<base name=\"%s\" id=\"%ld\" addr=\"%x\" />\n", item_name, ++id, s.item );
Delete(item_name);
}
indent_level -= 4;
print_indent(0);
Printf( out, "</baselist >\n" );
}
String *Xml_escape_string(String *str) {
String *escaped_str = 0;
if (str) {
escaped_str = NewString(str);
Replaceall( escaped_str, "&", "&amp;" );
Replaceall( escaped_str, "<", "&lt;" );
Replaceall( escaped_str, "\"", "&quot;" );
Replaceall( escaped_str, "\\", "\\\\" );
Replaceall( escaped_str, "\n", "&#10;" );
}
return escaped_str;
}
void Xml_print_module(Node *p)
{