473,387 Members | 1,481 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 934

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

Similar topics

0
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 0.6 and earlier than 0.7. unfortunaltly i can...
2
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 stuck at the first hurdle. I have the following: ...
2
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, but this resolves all entities and serializes...
1
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 application on RISCOS (OS on ARM processor) where only...
2
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 python/site-packages/_xmlplus modules but not _xmlplus/sax...
1
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 libraries like PyXML. The documentation for my version...
1
by: PyPK | last post by:
How do I add a new attribute to the existing xml Document tree???
5
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? ^^ I also have to catch SAXExceptions, which reside...
3
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 package available for python2.4, but without luck....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.