RE: [xml] ¿Non empty node?



Solved, the problem was in the internal process of my application.

When I make new child node with no content I used xmlNewChild with content =
"", and this create in the child a new text node with "".

Thank to all.

-----Mensaje original-----
De: Morus Walter [mailto:morus walter tanto-xipolis de]
Enviado el: martes, 02 de julio de 2002 8:31
Para: xml gnome org; Samuel Díaz
Asunto: 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]