Suppose we have this XML document
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE note [
<!ELEMENT note (to,from,heading,body, foo)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
<!ELEMENT foo ANY>
]>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
<foo><stuff>test</stuff></foo>
</note>
I’m using the ANY keyword for the element “foo” but I get an error saying
Line 20, Column 16: element "stuff" undefined
from this site http://validator.w3.org/check
why is this happening? isn’t any supposed to accept any kind of parsable data in the foo element?
ANYmeans “Any element type defined in the DTD” not “Any element type the author cares to invent”.From the specification:
(My emphasis)