I reproduced this behaviour with: * libxml-2.6.6 (mandrake-rpm) * libxml-2.5.7 (rh-rpm)
I also posted this question on the libxml2 maillinglist. I've not been sure (although I doubt) it is a bug.
Tom
Christian Glahn wrote:
Hey Tom,
could you please post the libxml2 version you use?
that helps to find the problem.
Christian
On Wed, 2004-03-10 at 10:26, Tom Schindl wrote:
Hi,
well that's not really AxKit related but I know that there are many XML-Gurus following this list.
Take a look at the following DTD's:
DTD-1: ---------------------8<--------------------- <!ELEMENT foo ( bar, beso:bar )> <!ATTLIST foo xmlns:beso CDATA #REQUIRED
<!ELEMENT bar EMPTY> <!ATTLIST bar beso:testbar CDATA #IMPLIED testbar CDATA #IMPLIED>
<!ELEMENT beso:bar EMPTY> ---------------------8<---------------------
DTD-2: ---------------------8<--------------------- <!ELEMENT foo ( bar, beso:bar )> <!ATTLIST foo xmlns:beso CDATA #REQUIRED
<!ELEMENT bar EMPTY> <!ATTLIST bar beso:testbar CDATA #IMPLIED testbar CDATA #REQUIRED>
<!ELEMENT beso:bar EMPTY> ---------------------8<---------------------
DTD-3: ---------------------8<--------------------- <!ELEMENT foo ( bar, beso:bar )> <!ATTLIST foo xmlns:beso CDATA #REQUIRED
<!ELEMENT bar EMPTY> <!ATTLIST bar beso:testbar CDATA #IMPLIED testbar CDATA #REQUIRED> ---------------------8<---------------------
XML: ---------------------8<--------------------- <?xml version="1.0" ?> <!DOCTYPE foo SYSTEM "./test.dtd" > <foo xmlns:beso="http://www.bestsolution.at/testns"> <bar beso:testbar="bli" testbar="blo" /> <beso:bar beso:testbar="bli" testbar="blo" /> </foo> ---------------------8<---------------------
Using xmllint(xmllint --valid --noout test.xml) I expected the following results:
DTD1: invalid => no attribute (beso:testbar,testbar) in beso:bar DTD2: invalid => no attribute (beso:testbar,testbar) in beso:bar DTD3: invalid => no element beso:bar in foo
But got:
DTD1: valid (is there some inheritance???if yes, see DTD2)
DTD2: valid (if attributes are inherited why does #REQUIRED is transformed to #IMPLIED)
DTD3: valid
What am I missing, is libxml's DTD-Validation broken or does it follow the XML-specs?
thx
Tom
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]