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

Re: [xml] ¿Non empty node?



Samuel Díaz writes:

> In the DTD I declare:
> 
> <!ELEMENT KK EMPTY>
> <!ATTLIST KK AT CDATA>
> 
that should be <!ATTLSIT KK AT CDATA #IMPLIED> or something like that.
Otherwise the attlist declaration is wrong.

> The first question: Is my element KK empty?
> 
yes. 
However there may not even be whitespace between the start and end tag.

> The second question: Why the "xmlValidateDocument" function invoque my
> "errorfunct" with the string "Element KK was declared EMPTY this one has
> content"?
> 
using xmllint I cannot see this problem:
cat teste.xml
<!DOCTYPE KK [
<!ELEMENT KK EMPTY>
<!ATTLIST KK AT CDATA #IMPLIED>
]>
<KK AT="kk"></KK>

xmllint --valid teste.xml
<?xml version="1.0"?>
<!DOCTYPE KK [
<!ELEMENT KK EMPTY>
<!ATTLIST KK AT CDATA #IMPLIED>
]>
<KK AT="kk"/>

So libxml seems to be right and I suspect something else is going wrong 
in your application.

HTH greetings
	Morus




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