[XML-SIG] (no subject)
Andrew Maclean
andyjmaclean at hotmail.com
Mon Jan 5 07:54:19 EST 2004
Dear sir,
I'm having a problem with xmlproc. Eventually I hope to use this product to
validate xml files against a schema but in the meantime I'm trying to get to
grips with basic functionality.
My problem is with the command "parse_resource", which results in a
SystemExit error. The test xml file I use can be opened as a file and I can
use the "feed" command within a while loop to do some simple parsing of it
(this tells me it finds the file and links my XMLProcessor object to the
MyApp object) but the minute I try and use "parse_resource('C:/test.xml')"
it shuts down my Zope instance.
The relevant section of code is below, I took it from an example I found on
the internet:
file = 'C:/Andy/XSL/test.xml'
p = xmlproc.XMLProcessor()
p.set_application(MyApp())
try:
p.parse_resource(file)
except IOError, (errno, strerror):
print "I/O error(%s): %s" % (errno, strerror)
except ValueError:
print "Could not convert data to an integer."
except:
print "Unexpected error:", sys.exc_info()[0]
raise
print
#prints "Unexpected error:SystemExit" before disappearing, the guilty line
is the call to parse_resource
I'm running on Windows XP. The pyXml modules are all installed properly
because I'm using Silva Zope (0.9.1). Can you please help?
Thanks,
Andy Maclean
_________________________________________________________________
Stay in touch with absent friends - get MSN Messenger
http://www.msn.co.uk/messenger
More information about the XML-SIG
mailing list