Create an internal DTD for Employee XML document.
CODING:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE employeeDB[
<!ELEMENT employeeDB (employee+)>
<!ELEMENT employee (id,name,department)+>
<!ELEMENT id (#PCDATA)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT department (#PCDATA)>
]>
<employeeDB>
<employee>
<id>
101
</id>
<name>
Tony Stark
</name>
<department>
Administration
</department>
</employee>
<employee>
<id>
102
</id>
<name>
Pepper Potts
</name>
<department>
Execution
</department>
</employee>
<employee>
<id>
103
</id>
<name>
Rhodey Rhodes
</name>
<department>
Security
</department>
</employee>
</employeeDB>
CODING:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE employeeDB[
<!ELEMENT employeeDB (employee+)>
<!ELEMENT employee (id,name,department)+>
<!ELEMENT id (#PCDATA)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT department (#PCDATA)>
]>
<employeeDB>
<employee>
<id>
101
</id>
<name>
Tony Stark
</name>
<department>
Administration
</department>
</employee>
<employee>
<id>
102
</id>
<name>
Pepper Potts
</name>
<department>
Execution
</department>
</employee>
<employee>
<id>
103
</id>
<name>
Rhodey Rhodes
</name>
<department>
Security
</department>
</employee>
</employeeDB>
Comments
Post a Comment