[XML-SIG] processing "special characters" efficiently

Craig.Curtin@wdr.com Craig.Curtin@wdr.com
Thu, 6 Apr 2000 15:57:43 -0500


--openmail-part-149a7002-00000002
Content-Type: text/plain; charset=ISO-8859-1; name="BDY.RTF"
Content-Disposition: inline; filename="BDY.RTF"
Content-Transfer-Encoding: quoted-printable

hi,
i'm looking for an efficient mechanism for filtering out
XML special characters....

the following code executes in slo-mo, can anyone =20
identify a more efficient way? this is obviously not
optimal. any help is appreciated.

thanks,

craig

text2XMLSpecialCharacters=3D{   '&': '&', =20
                        '<': '&lt;', =20
                        '>': '&gt;', =20
                  }

for k in text2XMLspecialChars.keys():
      data =3D string.replace(data, k, text2XMLspecialChars[k])


This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.

--openmail-part-149a7002-00000002
Content-Type: multipart/mixed; boundary="retimiled-emim-detsen-mijooneldraneldeen"

--retimiled-emim-detsen-mijooneldraneldeen
Content-Type: application/rtf; name="BDY.RTF"
Content-Disposition: attachment; filename="BDY.RTF"
Content-Transfer-Encoding: base64

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZGVmZjBcZGVmbGFuZzEwMzN7XGZvbnR0Ymx7XGYw
XGZzd2lzc1xmY2hhcnNldDAgQXJpYWw7fX0NClx2aWV3a2luZDRcdWMxXHBhcmRcZjBcZnMy
MCBoaSxccGFyDQppJ20gbG9va2luZyBmb3IgYW4gZWZmaWNpZW50IG1lY2hhbmlzbSBmb3Ig
ZmlsdGVyaW5nIG91dFxwYXINClhNTCBzcGVjaWFsIGNoYXJhY3RlcnMuLi4uXHBhcg0KXHBh
cg0KdGhlIGZvbGxvd2luZyBjb2RlIGV4ZWN1dGVzIGluIHNsby1tbywgY2FuIGFueW9uZSBc
cGFyDQppZGVudGlmeSBhIG1vcmUgZWZmaWNpZW50IHdheT8gdGhpcyBpcyBvYnZpb3VzbHkg
bm90XHBhcg0Kb3B0aW1hbC4gYW55IGhlbHAgaXMgYXBwcmVjaWF0ZWQuXHBhcg0KXHBhcg0K
dGhhbmtzLFxwYXINClxwYXINCmNyYWlnXHBhcg0KXHBhcg0KdGV4dDJYTUxTcGVjaWFsQ2hh
cmFjdGVycz1ce1x0YWIgJyYnOiAnJmFtcDsnLCBccGFyDQpcdGFiXHRhYlx0YWJcdGFiICc8
JzogJyZsdDsnLCBccGFyDQpcdGFiXHRhYlx0YWJcdGFiICc+JzogJyZndDsnLCBccGFyDQpc
dGFiXHRhYlx0YWJcfVxwYXINClxwYXINCmZvciBrIGluIHRleHQyWE1Mc3BlY2lhbENoYXJz
LmtleXMoKTpccGFyDQpcdGFiIGRhdGEgPSBzdHJpbmcucmVwbGFjZShkYXRhLCBrLCB0ZXh0
MlhNTHNwZWNpYWxDaGFyc1trXSlccGFyDQp9DQoA

--retimiled-emim-detsen-mijooneldraneldeen
Content-Type: text/plain; charset=us-ascii; name="disclaim.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Content-Description: Legal Disclaimer


This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.

--retimiled-emim-detsen-mijooneldraneldeen--

--openmail-part-149a7002-00000002--