Originally posted by Siarhei Adzinets:
Got a question in a mock exam, if this document is valid. The answer was no, because though an element was declared with ANY content, it could contain only declared elements. I guess this is wrong. Any thoughts?
No.
![]()
It is correct !!
Here is the quote from the DTD specs
Well-formedness constraint: Element Type Match
The Name in an element's end-tag MUST match the element type in the start-tag.
An element is valid if there is a declaration matching elementdecl where the Name matches the element type, and one of the following holds:
The declaration matches ANY, and the content (after replacing any entity references with their replacement text) consists of character data and child elements whose types have been declared.
To see more see this link
http://www.w3.org/TR/REC-xml/ and search for "Validity constraint: Element Valid" using "find box" in Edit menu

in IE
Hope this helps
