0
1.7kviews
Design XML DTD file and XML document file


Design XML DTD file and XML document file for the following relational schema:

Customer(cname, cresidence, ctel)

Item( item_name, item_code)

Order_request( customer, set_of_product)

Ctel can be a residence number or a mobile number.

1 Answer
0
5views

order_file.dtd XML DTD

<! DOCTYPE order_request [
<!ELEMENT order_request(customer,item*)>
<!ELEMENT customer(cname,cresidence,ctel)>
<!ELEMENT cname(#PCDATA)>
<!ELEMENT cresidence(#PCDATA)>
<!ELEMENT ctel(residence| mobile)>
<!ELEMENT residence(#PCDATA)>
<!ELEMENT mobile(#PCDATA)>
<!ELEMENT item(item_name,item_code)>
<!ELEMENT item_name(#PCDATA)>
<!ELEMENT item_code(#PCDATA)>
]>

Order_request.xml
<?xml version=”1.0” standalone=”no”?>
<!DOCTYPE orderrequest SYSTEM “order_file.dtd”>
<order_request>
    <customer>
        <cname> Jack</cname>
        <cresidence> JAPAN </cresidence>
        <ctel>
            <residence> 022-23456789</residence>
            </ctel>
    </customer>
    <item>
        <item_name> Microwave </item_name>
        <item_code> 001</item_code>
    </item>
    <item>
        <item_name> Cupboard </item_name>
        <item_code> 002</item_code>
    </item>
    <item>
        <item_name> Dish Washer </item_name>
        <item_code> 003</item_code>
    </item>
</order_request>
Please log in to add an answer.