Create DTD
Can someone please help me with this question, i am still new at java and i am battling with this question..
Thanx, any help will be appreciated.:(
Below is an XML file for an online delivery company. Each day, a list of deliveries to be made is
generated, if there any deliveries. There are a maximum of 10 deliveries made daily. Each
delivery is accompanied by an invoice detailing the clients name and contact details, a preferred
choice of courier service (from the three courier vendors enlisted by the company). The
province is one of nine, each identified by either two letters (e.g. GP) or three letters (e.g. KZN).
The invoice also contains the number of purchases made, the total amount excluding tax and
the payment method which is restricted to cash, credit card (CC), cheque or debit orders.
a) Create a DTD for the xml document to prevent errors in the content and structure.
b) Create a corresponding schema that gives the kind of control over data quality that will be
required.
<?xml version="1.0" encoding="UTF-8"?>
<Deliveries date="07/03/2007">
<Invoice date="03/03/2007" ID="21022">
<ShippingInfo>
<CustomerName>Jones Jones</CustomerName>
<Address postalCode="0003">
<Street>12 Preller</Street>
<Suburb>Muckleneuk</Suburb>
<City>Pretoria</City>
<Province>GP</Province>
</Address>
<DeliveryMethod>DHL</DeliveryMethod>
</ShippingInfo>
<Bill>
<ItemsSold>3</ItemsSold>
<SubTotal>107.99</SubTotal>
<PaymentMethod>CC</PaymentMethod>
</Bill>
</Invoice>
<Invoice date="01/03/2007" ID="21019">
<ShippingInfo>
<CustomerName>Kubeka Mofekeng</CustomerName>
<Address postalCode="3122">
<Street>5 Kingston</Street>
<Suburb>Pallow</Suburb>
<City>Cape Town</City>
<Province>WC</Province>
</Address>
<DeliveryMethod>UPS</DeliveryMethod>
</ShippingInfo>
<Bill>
<ItemsSold>1</ItemsSold>
<SubTotal>536.29</SubTotal>
<PaymentMethod>Cash</PaymentMethod>
</Bill>
</Invoice>
<Invoice date="01/03/2007" ID="21010">
<ShippingInfo>
<CustomerName>Rakesh Naidoo</CustomerName>
<Address postalCode="2312">
<Street>102 Marines Parade</Street>
<Suburb>Durban</Suburb>
<City>Pretoria</City>
<Province>KZN</Province>
</Address>
<DeliveryMethod>IMNS</DeliveryMethod>
</ShippingInfo>
<Bill>
<ItemsSold>4</ItemsSold>
<SubTotal>55.99</SubTotal>
<PaymentMethod>Cheque</PaymentMethod>
</Bill>
</Invoice>
</Deliveries>
|