How to create Xml for a book store application and display it?

A book store has a collection of books with various categories. It includes fiction,non fiction based books, general books, Technical books. In  this example, the book store has computer science based books.

Each book has a title,author(s),category it belongs, publications details and price of the book.The code is given below...

XML program for book store application is given below. 

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

<book_store>

<book>

<title>The art of computer programming</title>

<author> Donald E.Knuth</author>

<category> Computers</category>

<publications> Addison wesley</publications>

<price> 10,060</price>

</book>

<book>

<title>Code </title>

<author> Charles Petzold </author>

<category> Coding </category>

<publications> Microsoft Press</publications>

<price> 1500</price>

</book>

<book>

<title>Artificial intelligence: A modern approach </title>

<author> Stuart russell</author>

<author>peter norvig </author>

<category> Modern computers</category>

<publications>Pearson Education </publications>

<price>4,600 </price>

</book>

<book>

<title> Algorithms to live by</title>

<author> Brain christian</author>

<author> Tom  griffiths</author>

<category> Algorithms</category>

<publications>  Henry holt and company</publications>

<price>1860 </price>

</book>

<book>

<title> The C Programming Language</title>

<author> Brain W.Kernighan</author>

<author> Dennis Ritchie </author>

<category> Programming</category>

<publications> Pearson Education</publications>

<price>250 </price>

</book>

</book_store>


To format this, you can any formatter available in websites. To view the xml, use any XMLviewer available as free.
My xml file's formatted and tree view is given below

Formatted XML                                           Tree view

Formatted XML                                                 Tree view
This is the easy way to create a book store application in  XML.




 

No comments:

Post a Comment