[cxml-devel] validating XML: document

Alexandre Rademaker arademaker at gmail.com
Thu Mar 15 01:06:27 UTC 2012


Hello,

I need to validate a XML file that doesn't have the doctype
declaration. Actually, I don't control how the XML files are created
so I am not able to change the fact that those files don't have
doctype declarations. My problem is how to validate does files agains
a DTD. I found at http://common-lisp.net/project/cxml/sax.html#parser
that the correctly way should be:

> (let ((d (cxml:parse-file "0675365413696898.xml" (cxml-dom:make-dom-builder)))
	       (x (cxml:parse-dtd-file "LMPLCurriculo.DTD")))
	   (dom:map-document (cxml:make-validator x #"CURRICULO-VITAE") d))

But that gives me two warnings and return a NIL

Warning: deprecated SAX default method used by a handler that is not a
         subclass of SAX:ABSTRACT-HANDLER or HAX:ABSTRACT-HANDLER
Warning: deprecated SAX default method used by a handler that is not a
         subclass of SAX:ABSTRACT-HANDLER or HAX:ABSTRACT-HANDLER
NIL

It seems to work. I also tried with an invalid XML and the code fired
an error! Nevertheless, what are bothering me are does warnings!! Any
idea?

Best,

Alexandre Rademaker
http://arademaker.github.com/




More information about the cxml-devel mailing list