[xml] Questions about xmllint: possible bug?



I have a couple of questions about xmllint, including what I think may be
a bug:

First of all, is it possible to tell xmllint NOT to complain about a
missing <DOCTYPE> entry, or failing that, to not complain about a missing
DTD? The reason is that I am wanting to use a RelaxNG schema for
validation (as it will allow me to be "tighter" in my validation than a
DTD can be), and I cannot synthesize a DTD from my schema (trang cannot
handle the fact that I use the same sub-element name two different
elements, among other problems).

Obviously, if somebody can point me at a tool that can do the RelaxNG to
DTD conversion better than trang does, I'd far rather generate a DTD and
have that in the XML.

Second of all, xmllint is, in my opinion, mis-reporting where errors
happen: consider the following XML

<?xml version="1.0" encoding="UTF-8"?>
<root>
<element_1>
  <thing/>
  <thing2/>
</element_1>
<element_2>
  <thing3/>
  <thing4/> <!-- NOT ALLOWED BY SCHEMA -->
</element_2>
</root>

xmllint is reporting
test.xml:3: element element_1: Relax-NG validity error : Element root has
extra content: element_1

However, the error is in element_2 - that is the element which has the
content that is not defined in the schema.

Am I missing something subtle here, or is this a bug in xmllint?

The output from "xmllint --version" is:

xmllint --version
xmllint: using libxml version 20623
   compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1
FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude
Iconv ISO8859X Unicode Regexps Automata Expr Schemas Schematron Modules
Debug




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