on DTD mock 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)* >]>
<!ELEMENT elm1 (#PCDATA)>
<!ELEMENT elm2 (#PCDATA)>
d)<!DOCTYPE test [ <!ELEMENT test test (#PCDATA)>]>
e)<!DOCTYPE test [ <!ELEMENT test "test" (#PCDATA)>]>
Answer : a c
Can anyone tell me why C is correct? I tried it. It fails.
Cannot have a DTD declaration outside of a DTD. Error processing resource 'file:///D:/Test/xml/QQEnglish/src/words.xml'. Line 4, Position 15
<!ELEMENT elm1 (#PCDATA)>
--------------^
Thanks