Re: [xml] XML validation



On Mon, Jan 15, 2007 at 05:52:19PM -0800, Rush Manbert wrote:
Yan Seiner wrote:
I have an embedded system that uses XML extensively.  Many of the XML 
files are modified and generated by other software.  I am looking for a 
simple XML well-formedness checker, something I can point at an XML file 
and tell the user that s/he has a problem with file xyz.xml around line 
YYY or maybe element XXX.

Does any such thing exist?  I've found RXP, but it doesn't use 
libxml.... I really don't want to introduce more stuff into my (already 
bloated) embedded box...

The obvious answer is xmllint 

  yes

(which needs a DTD).

  no :-) . Well formedness is tested just by running
    xmllint --noout file.xml

and only well-formedness errors will be printed there, and possibly some
warning (which can be suppressed with --nowarning).
Then validity can be checked against the DTD (--valid or --dtdvalid),
or XSD and Relax-NG (see xmllint help), but that doesn't seems to be the
question.

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/



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