[XML-SIG] Newbie : Identifying characters that will choke XML parser

Ian Sparks Ian.Sparks@etrials.com
Tue, 6 May 2003 08:17:15 -0400


Hmm...as I feared. As I discover new XML-chokers I'm building up a =
library like :

#Remove ACK's (I've seen it!)
w =3D w.replace(chr(6),'')
#Remove ... characters (again, I've seen it)
w =3D w.replace(chr(133),'')

I was hoping to find some way of identifying everything that will choke =
my XML, some rule to auto-filter out the nastiness..


-----Original Message-----
From: Martin v. L=F6wis [mailto:martin@v.loewis.de]
Sent: Monday, May 05, 2003 6:10 PM
To: Ian Sparks
Cc: Xml-Sig (E-mail)
Subject: Re: [XML-SIG] Newbie : Identifying characters that will choke
XML parser


"Ian Sparks" <Ian.Sparks@etrials.com> writes:

> I build an XML document from data pulled from a database. Sometimes
> the database contains "bad" characters, how can I filter out the bad
> and properly encode the good?

If you want to completely discard the bad characters, I recommend use
use string.replace.

Regards,
Martin