I have write the following XML file with internal DTD.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE welcome [
<!ELEMENT welcome (firstname|lastname)>
<!ELEMENT firstname (#PCDATA)>
<!ELEMENT lastname (#PCDATA)>
<!ENTITY val "abineshlal">
]>
<welcome>
<middlename>sm</middlename>
<firstname>&val;</firstname>
<lastname>welcome</lastname>
</welcome>
I got the output of entity in browser. In my DTD I mentioned only firstname and lastname element in the welcome tag. But I used middle name tag in welcome tag. But I didnt get any error message in output.
I want to the real use of DTD in XML and what it is doing in XML.