472,333 Members | 1,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,333 software developers and data experts.

pyXML exceptions


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()



#-à 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 ?

Odd Bjørnstad
Jul 18 '05 #1
0 902

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: leo | last post by:
hi there i want to write a little SOAP client and thought about using ZSI. now i have read that ZSI only works with PyXML versions later than...
by: David Dorward | last post by:
I'm attempting to read an XHTML 1.1 file, perform some DOM manipulation, then write the results to a different file. I've found myself rather...
by: Sebastian Fey | last post by:
hi, id like to do the following: (1) open a .xml, change something and save it. problem is: how to save/serialize? i tried xml.dom.ext.Print,...
by: Alain | last post by:
Hi ! I'm looking for an XPath implementation (even partial) on PyXML. I'm using libxml2 on Windows XP. It works well but I have to port my...
by: Stefan Behnel | last post by:
Hi! I'm using PyXML 0.8.3 on a number of machines. When I now run import xml.sax.saxlib python touches both the python/xml/sax and...
by: Dan | last post by:
I'm writing a Python program that does some XML parsing, though nothing heavy, and I want to avoid requiring the user to install additional...
by: PyPK | last post by:
How do I add a new attribute to the existing xml Document tree???
by: Matthias Kaeppler | last post by:
Hi, I have to say I am confused about the documentation on pyxml.sf.net. When I want to use DOM, I effectively am using a class called Sax2? ^^...
by: Thomas W | last post by:
I've tried to install the pyxml-package, available at http://pyxml.sourceforge.net/, both from source and using some hack on the win32-binary...
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.