Validating xml files

Sjoerd Mullender sjoerd at oratrix.nl
Mon Dec 11 09:09:28 EST 2000


I have a DTD validator that is still a work-in-progress, but it
behaves pretty well already.  It's slow though.  I can mail it to you
(and anybody else who wants it).

On Mon, Dec 11 2000 Sergio Boix Moriano wrote:

>     Hi all,
> 
>         I´m using the PyXML-0.5.5.1 library to work with xml files. We
> generate the xnl files from a database and we need to validate this
> files cause later we have to do an insert in another dataabse with the
> xml contents, and the file must only have fields and tables that exits
> in the database.
> 
>        I´ve tried to use the DTDParser() class, but lokking at the code
> i´ve seen that the functions in the class doesn´t do nothing. The code
> of this classes in the saxlib module is:
> class DTDHandler:
>     def notationDecl(self, name, publicId, systemId):
>         "Handle a notation declaration event."
>         pass
> 
>     def unparsedEntityDecl(self, name, publicId, systemId, ndata):
>         "Handle an unparsed entity declaration event."
>         pass
> 
> 
>     Does anyone know anyway to read an xml file validating it with a
> DTD, in a way that if the xml is bad formed it gives me an error.
> 
>     Thanks in advance,
> 
> 
> 
> 
> -- 
> http://www.python.org/mailman/listinfo/python-list
> 

-- Sjoerd Mullender <sjoerd.mullender at oratrix.com>




More information about the Python-list mailing list