Interview Questions

Can I use qualified names in DTDs?

XML Interview Questions and Answers


(Continued from previous question...)

88. Can I use qualified names in DTDs?

Yes.
For example, the following is legal:

<!ELEMENT google:A (google:B)>
<!ATTLIST google:A
google:C CDATA #IMPLIED>
<!ELEMENT google:B (#PCDATA)>

However, because XML namespace declarations do not apply to DTDs , qualified names in the DTD cannot be converted to universal names. As a result, qualified names in the DTD have no special meaning. For example, google:A is just google:A -- it is not A in the XML namespace to which the prefix google is mapped.
The reason qualified names are allowed in the DTD is so that validation will continue to work.

(Continued on next question...)

Other Interview Questions