6. Write an XML file that displays book information with the following fields: Title of the book, Author Name, ISBN number, Publisher name, Edition, and Price. Define a Document Type Definition (DTD) to validate the XML document created above.

PHOTO EMBED

Thu Oct 31 2024 16:12:35 GMT+0000 (Coordinated Universal Time)

Saved by @varuntej #kotlin

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)>

content_copyCOPY