[xml] Enhancement request: xmllint verbosity control



An xmllint validity check of a document containing an "unfinished"
element (one lacking required child element(s)) will emit the entire
content model for the element, like this:

  $ xmllint --valid --noout xmllinttest.xml
  xmllinttest.xml:9: validity error: Element chapter content doesn't follow the Dtd
  Expecting (beginpage? , chapterinfo? , (title , subtitle? ,
  titleabbrev?) , (toc | lot | index | glossary | bibliography)* ,
  tocchap? , (((calloutlist | glosslist | itemizedlist | orderedlist |
  segmentedlist | simplelist | variablelist | caution | important |
  note | tip | warning | literallayout | programlisting |
  programlistingco | screen | screenco | screenshot | synopsis |
  cmdsynopsis | funcsynopsis | classsynopsis | fieldsynopsis |
  constructorsynopsis | destructorsynopsis | methodsynopsis |
  formalpara | para | simpara | address | blockquote | graphic |
  graphicco | mediaobject | mediaobjectco | informalequation |
  informalexample | informalfigure | informaltable | equation |
  example | figure | table | msgset | procedure | sidebar | qandaset |
  anchor | bridgehead | remark | highlights | abstract | authorblurb |
  epigraph | indexterm | beginpage)+ , (sect1* | refentry* |
  simplesect* | section*)) | sect1+ | refentry+ | simplesect+ |
  section+) , (toc | lot | index | glossary | bibliography)*), got
  (title ) </chapter>
                    ^
  $

While seeing the content models can definitely be helpful, it may be
too much if you're trying to troubleshoot a document with a lot of
errors. So it'd be nice perhaps to have the option of emitting less
verbose output (that is, without the content models) similar to what
nsgmls emits:

  $ nsgmls -wxml -s c:/cygwin/usr/local/xml/xml/xml.dcl xmllinttest.xml
  nsgmls:c:/cygwin/usr/local/xml/xml/xml.dcl:1:W: SGML declaration was not implied
  nsgmls:xmllinttest.xml:9:11:E: end tag for "chapter" which is not finished
  $

-- 
Michael Smith
http://www.sideshowbarker.net






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