469,290 Members | 1,922 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,290 developers. It's quick & easy.

pyXML exceptions

Hello

Am parsing xml with pyXML and using the following code:

from xml.parsers.xmlproc import xmlproc

from xml.parsers.xmlproc import xmlval

from xml.parsers.xmlproc import xmldtd

..

..

def parser(xml,dtd):

print 'Start XML Parsing'

d = xmldtd.load_dtd(dtd)

p = xmlval.XMLValidator()

p.set_application(MyApp())

p.feed(xml)

#-à here I want to get some form of control over the messages (if syntax/
other error) that the parser print into console

print 'End XML Parsing'

..

..

..

I need to catch the messages thrown by the parser when there are syntax
errors in the XML or DTD.

These messages seems to be exceptions but it's a bit confusing not being
able to catch them.

Now I only get messages printed in the console but I want to put the
messages into a logfile or database table.

Any suggestions ?

Regards
Odd Bjørnstad
Jul 18 '05 #1
0 861

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by leo | last post: by
2 posts views Thread by David Dorward | last post: by
2 posts views Thread by Sebastian Fey | last post: by
1 post views Thread by Alain | last post: by
2 posts views Thread by Stefan Behnel | last post: by
1 post views Thread by Dan | last post: by
1 post views Thread by PyPK | last post: by
5 posts views Thread by Matthias Kaeppler | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.