[xml] DTD validation issue

Hi Daniel, All, 

the following inconsistency in DTD validation, reproducible with xmllint, was 
reported to me by a user of XSH2, Jakub Neburka.

He takes two files: decl.dtd and decl.xml and does basically the following:

1) xmllint --valid decl.xml
   xmllint --postvalid decl.xml

both succeed.

2) xmllint --shell decl.xml
/> validate

this, however, fails with

decl.xml:5: element root: validity error : Element root was declared EMPTY 
this one has content

(Probably because the library calls are alike, XSH2 behaves similarly: 
parse-time validation is fine, validating the in-memory tree fails).

The test cases follow.

<!ENTITY % cond "IGNORE">
<!ENTITY % content "ANY">
<!ENTITY % content "EMPTY">
<!ELEMENT root %content;>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE root SYSTEM "decl.dtd" [
<!ENTITY % cond "INCLUDE">

Can you confirm this is a bug? Shall I bugzilla it?

-- Petr

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