[XML-SIG] Help
Martin v. Loewis
martin@loewis.home.cs.tu-berlin.de
Mon, 19 Mar 2001 23:47:33 +0100
> I just downloaded BeOpen-Python-2.0.exe and installed it.
That is a good starting point.
> I then downloaded PythonXML.exe and installed that.
I don't know what that is - where did you get it?
> Then I downloaded PyXML-0.6.4.win32-py2.0.exe and installed it also.
That is also a good thing.
> My query is, what now?
You now need to write a Python program that makes use of the packages.
> How do I get the XML parser to run? I read in the docs that
> Python/XML has three(3) parsers. How do I run them?
That is a somewhat surprising request. Why do you want to run the
parsers? An XML parser, when run, typically does not do much (*).
To write a program that is a simple XML parser, please try
import sys, xml.sax
parser = xml.sax.parse(sys.argv[1], xml.sax.ContentHandler())
> Can I make them into an EXE for Windows? How can I do this?
There is a number of ways to make a Python program into an
executable. These are independent from PyXML; please see the Python
FAQ for details.
> How can I get an EXE to look at an XML file and its DTD and say if
> it is well-formed and all those other XML parsing tools?
The script above invokes a non-validating parser, so it will only tell
you if it is well-formed, not whether it is valid. To run a validating
parser, you need to instantiate xmlproc. The next release of PyXML
will actually include two command line utilities to run xmlproc; they
offer a few more features, though (such as outputting ESIS) -
i.e. they offer some specific processing.
Regards,
Martin
(*) It does perform the well-formedness check, and might even perform
validation. So all you get out of it are ill-formedness and invalidity
errors. If that is all you need PyXML might not be the appropriate
choice of tool.