(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
commit 25c8a3d592

View file

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