DTD Validation
DTD defines the XML structure with a list of elements, attributes, and entities. DTD is widely used in document-centric applications. DTD can be stored as a file or embedded in XML documents. The DTDs included within an XML document are called “internal DTDs.” An example is shown as follows (contact_list_in.xml):
<?xml version = ‘1.0’ encoding = ‘UTF-8’?>
<!DOCTYPE contact_list[
<!ELEMENT contact_list (contact+)>
<!ELEMENT contact (first_name,last_name)>
<!ELEMENT first_name (#PCDATA)>
<!ELEMENT last_name (#PCDATA)>
<!ATTLIST contact id CDATA #REQUIRED>
<!ENTITY author “John Smith”>
<!ENTITY book “Oracle Database 11g: Building Oracle XML DB Applications”>]>
<contact_list>
<contact id=“1”>
<first_name>John</first_name>
<last_name>Smith</last_name> ...
Get Oracle Database 11g Building Oracle XML DB Applications now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.