[XML-SIG] xml.parsers.expat not converting aliased CDATA elements

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Fri, 25 May 2001 22:38:43 +0200


> An example of the behavior I am talking about is input that includes the
> following:
> 
> '<reference> Morse &amp; Feshbach </reference>'
> 
> With a CDATA handler:
> 
> 'def char_data(data):
> 	print data'
> 
> Will return 'Morse & Feshbach', when I would like it to return the
> original string, as is.

Fred already mentioned the default handler, but I'd like you to
reconsider your request: &amp; and & are really the same thing; one is
marked-up, the other is not.

If you have a need to output the contents again as XML, you may find
xml.sax.saxutils.escape useful.

Regards,
Martin