[xml] possible bug in RELAX NG validator


RELAX NG validation with xmllint (libxml version 20705) gives incorrect
results when faced with the following invalid schema:

== file: optroot.rng ==
<?xml version="1.0"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0";
      <element name="foo">
        <element name="bar">

The schema is invalid because the document element "foo" is optional -
start//empty path is prohibited in sec. 10.2.6 of the RELAX NG spec.
However, xmllint doesn't report an error but instead successfully
validates the following document with extra bogus content:

== file: optroot.xml ==
<?xml version="1.0"?>
<foo:foo xmlns:foo="http://example.com/foo";>

$ xmllint --noout --relaxng optroot.rng optroot.xml
optroot.xml validates

Jing does the right thing:

$ jing optroot.rng optroot.xml
error: "start" contains "empty"

Regards, Lada

Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C

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