Once again, I apologize if this has been discussed before.
Here is question 3 from the Exam List's DTD Exam:
3. Which of the following code is valid?
a)<!DOCTYPE
test [ <!ELEMENT test (#PCDATA)>]>
b)<!DOCTYPE test [ <!ELEMENT test.dtd (elm1|elm2|#PCDATA) >]>
c)<!DOCTYPE test [ <!ELEMENT test.dtd (#PCDATA|elm1|elm2)* >]>
d)<!DOCTYPE test [ <!ELEMENT test test (#PCDATA)>]>
e)<!DOCTYPE test [ <!ELEMENT test "test" (#PCDATA)>]>
Answer : a c
It says that answer a & c are both correct. I believe only answer 'a' to be correct, because 'c' states that the root element is 'test' and then goes on to declare that root element as 'test.dtd', making the code invalid.
I guess it is possible that the element declaration is not the root and assumes that there would be other element declarations to come before it (one of which would be a root element called 'test.dtd'). That doesn't seem likely, nor does it make this code (as it is) anymore valid.
Can someone give me some feedback on this?
Thanks in advance.