0% found this document useful (0 votes)
154 views3 pages

Web Technology Lab Report 2

The document demonstrates using XML to represent a bookstore catalog with multiple books categorized by genre, each with title, author, year, and price tags. It then validates an XML employee record using a DTD that defines the employee element and its child elements of firstname, lastname, and email. In both examples the XML is displayed before and after being processed to demonstrate the results.

Uploaded by

Aaneill Crest
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
154 views3 pages

Web Technology Lab Report 2

The document demonstrates using XML to represent a bookstore catalog with multiple books categorized by genre, each with title, author, year, and price tags. It then validates an XML employee record using a DTD that defines the employee element and its child elements of firstname, lastname, and email. In both examples the XML is displayed before and after being processed to demonstrate the results.

Uploaded by

Aaneill Crest
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Web Technology

Lab 2

Submitted By: Submitted To:


Name:
Roll.No:
XML showing with bookstore

<?xml version="1.0" encoding="UTF-8"?>


<booklist>
<book category="java">
<title lang="en">Polymorphism</title>
<author>Someperson</author>
<year>2005</year>
<price>60.00</price>
</book>
<book category="CHILDREN">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>60</price>
</book>
<book category="WEB">
<title lang="en">Learning XML</title>
<author>Ramesh singh saud</author>
<year>2019</year>
<price>12095</price>
</book>
</bookstore>

Result of XML-

<booklist>
<book category="java">
<title lang="en">Polymorphism</title>
<author>Someperson</author>
<year>2005</year>
<price>60.00</price>
</book>
<book category="CHILDREN">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>60</price>
</book>
<book category="WEB">
<title lang="en">Learning XML</title>
<author>Ramesh singh saud</author>
<year>2019</year>
<price>12095</price>
</book>
</bookstore>

XML using DTD-


employee.xml-

<?xml version="1.0"?>
<!DOCTYPE employee SYSTEM "employee.dtd">
<employee>
<firstname>ram</firstname>
<lastname>thapa</lastname>
<email>[email protected]</email>
</employee>

employee.dtt

<!ELEMENT employee (firstname,lastname,email)>


<!ELEMENT firstname (#PCDATA)>
<!ELEMENT lastname (#PCDATA)>
<!ELEMENT email (#PCDATA)>

Result-
<employee>
<firstname>ram</firstname>
<lastname>thapa</lastname>
<email>[email protected]</email>
</employee>

You might also like