Wrox Programmer Forums
|
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 28th, 2007, 03:55 AM
Authorized User
 
Join Date: May 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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>



 
Old June 15th, 2007, 06:51 AM
Friend of Wrox
 
Join Date: Dec 2003
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey Lizane,

This isn't really a Java question. You'd probably get better advice on an XML forum.

Good luck

--
Charlie Harvey's website - linux, perl, java, anarchism and punk rock: http://charlieharvey.org.uk





Similar Threads
Thread Thread Starter Forum Replies Last Post
Automated tool to convert XML from DTD to DTD lsantos2000 XSLT 2 October 17th, 2007 08:21 AM
Issue with DTD tgopal CSS Cascading Style Sheets 2 September 20th, 2006 04:15 AM
question DTD antiwind XML 1 February 24th, 2005 04:45 AM
Which DTD? Snib HTML Code Clinic 2 July 16th, 2004 03:34 AM
Help with DTD P Keshav XML 1 September 12th, 2003 12:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.