Re: [xml] DTD validation issue

On Tue, Feb 26, 2008 at 04:15:28AM -0500, Daniel Veillard wrote:
  Not a bug. When you do things like Post validation, you give it a
preparsed DTD. in that case the DTD was parsed without the context
of the document, while the internal subset changes the behaviour.

        Sorry Daniel, 
        a different example about validation and post validation.

--- begin "a.xml" ---
<?xml version="1.0"?>
<!DOCTYPE root SYSTEM "a.dtd">
<root ns:attr="1"/>
--- end "a.xml" ---

--- begin "b.xml" ---
<?xml version="1.0"?>
<root ns:attr="1"/>
--- end "b.xml" ---

--- begin "a.dtd" ---
<!ATTLIST root
          xmlns:ns CDATA #FIXED "";
          ns:attr CDATA #IMPLIED>
--- end "a.dtd" ---

        When i use 'xmllint' to verify the validity of "a.xml" against
"a.dtd" implicitly ("--valid") or explicitly ("--dtdvalid a.dtd"), all
goes well: "a.xml" result valid.

        But when i verify the validity of "b.xml" explicitly against
"a.dtd" ("--dtdvalid a.dtd"), i obtain the following error:

--- begin output ---
<root ns:attr="1"/>
b.xml:2: element root: validity error : No declaration for attribute 
attr of element root
Document b.xml does not validate against a.dtd
--- end output ---

        I suppose this is a bug (i'm wrong?) so i have inserted bug
445790 in bugzilla.

                massimo morara

"The glass is neither half empty nor half full. It is twice as large as
 it needs to be."
-- unknown

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