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

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


Hi,

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>

A parser is going to think that "<B>" is a new XML tag and it'll die saying 
that I have mismatched tags.  This field also may or may not have <*> type 
entries in it, or it might have many blocks like that.

Is there a way to set a processing flag to specify that I want to grab 
everything between <A> and </A> as a character buffer?  If there's not a 
built in way to grab that, is there a trick I can use to get the same 
effect?

I can't just flip a state in the parser and 'build' the string from 
startElement and endElement names because  the character data won't be well 
formed XML (no </> style elements)

Any help is greatly appreciated!
  -William

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