Re: [xml] xmllint as minimal non-validating parser?

On Thu, Sep 13, 2007 at 09:48:51PM -0400, Fred Drake wrote:
On Sep 13, 2007, at 5:33 PM, Chuck Bearden wrote:
Is there a way to make xmllint do no more than check documents
against the well-formedness constraints, to emulate a minimal
non-validating processor?

I hate to sound like advertising for the competition, but  
"xmlwf" (distributed with the Expat library) will handle this.

  Well, libxml2 behaviour is actually correct, and expat should also
signal this to applications. A missing entity may not be fatal for 
processing in some applications but a critical problem in others, basically
you have undefined results from a spec perspective. That's why 
libxml2 error API distinguish fatal errors from errors.

What's interesting is that xmllint exits with a return code of 0,  
though the man page claims that means no error (as expected),  

  no fatal error, i.e. the data could be delivered, and a tree was
built, maybe I could change the man page.

suggesting that this message is just a warning.  Using --nowarning  
doesn't suppress the message, however.  Perhaps this is a bug in the  
--nowarning support?

  There is no notion of warning in the XML spec, I still delivers some
in libxml2, even in the parser there are places where I raise warnings
(for example if the namespace names don't follow the RFC 2396 for 
absolute URI c.f. a controversial decision a long long time ago).
But in that case it's reported as an error, as I think it should,


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]