XML File (books.xml):
xml
Copy code
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE books SYSTEM "books.dtd">
<books>
<book>
<title>Wings of Fire</title>
<author>A.P.J Abdul Kalam</author>
<isbn>81-7371-146-1</isbn>
<publisher>Arun Tiwar</publisher>
<edition>1st</edition>
<price>180</price>
</book>
<book>
<title>Introduction to xml</title>
<author>Jane doe</author>
<isbn>978-0451524935</isbn>
<publisher>Tech Books Publisher</publisher>
<edition>1st</edition>
<price>29.99</price>
</book>
</books>
DTD File (books.dtd):
dtd
Copy code
<!ELEMENT books (book+)>
<!ELEMENT book (title, author, isbn, publisher, edition, price)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT isbn (#PCDATA)>
<!ELEMENT publisher (#PCDATA)>
<!ELEMENT edition (#PCDATA)>
<!ELEMENT price (#PCDATA)>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter