[XML-SIG] How do I process CDATA when the characters looks like XML

William McLendon txagcs98@hotmail.com
Wed, 14 May 2003 13:58:26 -0600


Thanks!  That did the trick.


>From: Mike Brown <mike@skew.org>
>To: William McLendon <txagcs98@hotmail.com>
>CC: xml-sig@python.org
>Subject: Re: [XML-SIG] How do I process CDATA when the characters looks 
>like XML
>Date: Wed, 14 May 2003 12:19:33 -0600 (MDT)
>William McLendon wrote:
> > I'm working with the basic python SAX parser (xml.sax.handler, etc) and 
>am
> > needing to process some XML that has "<" and ">" characters going in 
>CDATA
> > fields.
> >
> > For example, the model I want to have is this:
> >
> > <A>X</A>  where "X" is some kind of character data.
> >
> > but if X = <B> giving me this situation:
> >
> > <A><B></A>
>
>If you're wanting to put markup characters "<" or "&" in character data, 
>you
>must escape them, either using character or entity references, or the 
>special
>markup for a CDATA section:
>
><A>&lt;B></A>  (escaping the > is optional)
>or
><A><![CDATA[<B>]]></A>

_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail