Why is this an invalid XML DTD? (Parameter object and #PCDATA)

Using the DTD validator here , I was informed that the next DTD is not valid.

<!ENTITY % text "(#PCDATA|L)*">
<!ELEMENT H         (%text;)+>
<!ELEMENT L         (#PCDATA)>

Error message: “A” (“character” or item type is required in the item type declaration “H”. ”In row 2, column 22.

Can anyone point out why it is not valid? And how can I make it valid? The error message is not very friendly to me. Thank.

+3
source share
1 answer

You cannot guarantee that an element with mixed content must have at least one child element node. Your DTD is getting

<!ELEMENT H         ((#PCDATA|L)*)+>

. -

(#PCDATA | A | B | C)*

A, B C - . #PCDATA , 0- , .. .

+8

Source: https://habr.com/ru/post/1744779/


All Articles