[xml/sgml-pkgs] Bug#867378: libxml2-utils: xmllint option --postvalid reports valid documents as invalid
Andreas Hoenen
andreas at hoenen-terstappen.de
Thu Jul 6 06:42:56 UTC 2017
Package: libxml2-utils
Version: 2.9.4+dfsg1-2.2
Severity: normal
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dear Maintainer,
*** Reporter, please consider answering these questions, where appropriate ***
* What led up to the situation?
* What exactly did you do (or not do) that was effective (or
ineffective)?
* What was the outcome of this action?
* What outcome did you expect instead?
*** End of the template - remove these template lines ***
With option --postvalid xmllint chokes non ascii characters in attribute
values. The attached example demonstrates this misbehaviour: although it is a
valid docbook document, it is erroneously reported as invalid:
$ xmllint --xinclude --postvalid main.xml
<?xml version="1.0"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<article lang="en">
<title>xmllint postvalidation test</title>
<para id="fooß">
xmllint hat problems with post validation of XML attributes values containing
non ascii characters.
</para>
</article>
include.xml:5: element para: validity error : Syntax of value for attribute id of para is not valid
Document main.xml does not validate
$ echo $?
3
A workaround shows that the --valid option behaves correctly:
$ xmllint --xinclude --output - main.xml | xmllint --valid -
<?xml version="1.0"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<article lang="en">
<title>xmllint postvalidation test</title>
<para id="fooß">
xmllint hat problems with post validation of XML attributes values containing
non ascii characters.
</para>
</article>
$ echo $?
0
- -- System Information:
Debian Release: 9.0
APT prefers stable
APT policy: (990, 'stable'), (500, 'unstable'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.9.0-3-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages libxml2-utils depends on:
ii libc6 2.24-11+deb9u1
ii libxml2 2.9.4+dfsg1-2.2
libxml2-utils recommends no packages.
libxml2-utils suggests no packages.
- -- no debconf information
-----BEGIN PGP SIGNATURE-----
iHsEARECADsWIQSkpui1WTrom0lrgvByjYt+uIjSzgUCWV3b4x0cYW5kcmVhc0Bo
b2VuZW4tdGVyc3RhcHBlbi5kZQAKCRByjYt+uIjSzhS6AJ4jCOJoC7nhwgA7UH/X
/i+MboG5gQCeKQNfu5X01aawXVTSJ26wH0nEGAo=
=kSR1
-----END PGP SIGNATURE-----
-------------- next part --------------
<?xml version="1.0"?>
<!DOCTYPE para
PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<para id="foo?">
xmllint hat problems with post validation of XML attributes values containing
non ascii characters.
</para>
-------------- next part --------------
<?xml version="1.0"?>
<!DOCTYPE article
PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<article lang="en">
<title>xmllint postvalidation test</title>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="include.xml"/>
</article>
More information about the debian-xml-sgml-pkgs
mailing list