On Nov 18, 6:32 pm, Artie Ziff <artie.z...@gmail.com> wrote: > Unfortunately, xml parsing fails due to angle brackets inside > description tags. In particular, xml.etree.ElementTree.parse() > aborts on '<' inside xml data such as the following: > > <testname name="cron_test.sh"> > <description> > This testcase tests if crontab <filename> installs the cronjob > and cron schedules the job correctly. > <\description> > > ## > > What is right way to handle the extra angle brackets? > Substitute on line-by-line basis, if that works? > Or learn to write a simple stack-style parser, or > recursive descent, it may be called? > > I am open to comments to improve my code more to be more readable, > pythonic, or better. > > Many thanks > AZ
Start with cgi.escape perhaps? http://docs.python.org/2/library/cgi.html -- http://mail.python.org/mailman/listinfo/python-list