[XML-SIG] parsing xml files delimited with non-xml text

Brian Birkinbine bbirkinbine@earthlink.net
Tue, 23 Apr 2002 11:57:48 -0500


Hello,

I'm new to Python and XML, so please be gentle.  :)

I am using the xml.sax libraries with Python 2.2 on OpenBSD 2.9

I can successfully parse my xml data files without problems, but I am struggling with
the following.

Lets say I have a large text file with xml data separated with a delimiter line or other
non-xml header information (typical when using enterprise management systems for
data gathering from many systems (ie. Tivoli task output from many systems))

Should I strip out the non-xml data separately into xml-compliant pieces before
calling the parse routine, or can I use exception handling within the xml routines
to ignore the non-xml data until I see valid xml data?

I would prefer to use exception handling because my functions to strip out non-xml data
would have to recognize the start of an xml file, and the xml parser already knows
how to detect the start of xml data.

Thanks in advance
-- 
Brian Birkinbine <bbirkinbine@earthlink.net>
GnuPG/PGP Key: 0x37D55FF6