Answer to Question #257759 in HTML/JavaScript Web Application for Saksham

Question #257759
A book store maintains the list of all its Books using XML. A Book consists of an ISBN number, which can be used as its attribute in the XML document. The following information is stored about the Book - book title, list of authors, name of the publisher and price of the Book. Create an XML document containing information of five Books. Also create the DTD to verify the XML document created by you
1
Expert's answer
2021-10-29T00:53:59-0400

Bookstore.xml

<bookstore>
            <book>
                        <title>web programming</title>
                        <author>chrisbates</author>
                        <ISBN>123-456-789</ISBN>
                        <publisher>wiley</publisher>
                        <edition>3</edition>
                        <price>350</price>
            </book>
            <book>
                        <title>internet worldwideweb</title>
                        <author>ditel&amp;ditel</author>
                        <ISBN>123-456-781</ISBN>
                        <publisher>person</publisher>
                        <edition>3</edition>
                        <price>450</price>
            </book>
<book>
                        <title>C#</title>
                        <author>J.Smith</author>
                        <ISBN>123-456-789</ISBN>
                        <publisher>wiley</publisher>
                        <edition>3</edition>
                        <price>350</price>
            </book>
            <book>
                        <title>java</title>
                        <author>mercury</author>
                        <ISBN>123-456-781</ISBN>
                        <publisher>person</publisher>
                        <edition>3</edition>
                        <price>450</price>
            </book>
 <book>
                        <title>programming</title>
                       <author>welsh</author>
                        <ISBN>123-456-781</ISBN>
                        <publisher>person</publisher>
                        <edition>3</edition>
                        <price>450</price>
            </book>
</bookstore>

XML document Validation using DTD

 <xs:element name="bookstore">
                        <xs:complexType>
                        <xs:sequence>
<xs:element name="book" maxOccurs="unbounded">
<xs:complexType>
            <xs:sequence>
<xs:element name="title"       type="xs:string"></xs:element>
<xs:element name="author"  type="xs:string"></xs:element>
<xs:element name="ISBN"    type="xs:string"></xs:element>
<xs:element name="publisher"          type="xs:string"></xs:element>
<xs:element name="edition"  type="xs:int"></xs:element>
<xs:element name="price"     type="xs:decimal"></xs:element>
            </xs:sequence>
</xs:complexType>


</xs:element>
                     
                        </xs:sequence>
                        </xs:complexType>
           
            </xs:element>
</xs:schema>

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS