(Xml_print_attributes): Do "&" replacement

before any others that might introduce "&" into
the stream.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4230 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Thien-Thi Nguyen 2003-01-08 12:19:28 +00:00
parent ae4f3e72b3
commit 25c8a3d592
1 changed files with 64 additions and 63 deletions

View File

@ -174,8 +174,9 @@ public:
{
o = Str(Getattr(obj,k));
Replaceall( k, ":", "_" );
Replaceall( o, "<", "&lt;" );
/* Do first to avoid aliasing errors. */
Replaceall( o, "&", "&amp;" );
Replaceall( o, "<", "&lt;" );
Replaceall( o, "\"", "&quot;" );
Replaceall( o, "\\", "\\\\" );
Printf(out,"<attribute name=\"%s\" value=\"%s\" id=\"%ld\" addr=\"%x\" />\n", k, o, ++id, o );