[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.

__decl.dtd__
<!ENTITY % cond "IGNORE">
<![%cond;[
<!ENTITY % content "ANY">
]]>
<!ENTITY % content "EMPTY">
<!ELEMENT root %content;>
__CUT__

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

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]