1. Engineering
  2. Computer Science
  3. benjamin needs your help with a document that lists some...

Question: benjamin needs your help with a document that lists some...

Question details

Benjamin needs your help with a document that lists some of Map Finds For Yous map products. Figure 2-32 shows the tree structure of Benjamins XML document. U 0 Figure 2-3:2 Structure of the products product desc isbn The document contains a root element named products with one or more occurrences of the product element containing information on map products. The product element contains five child elements- name, versionDate, desc, an optional isbn, and price. The name element stores the name of the prod- uct and supports two attributes-pid, the ID number of the product; and category, the type of product (historical, state, or parks). The versionDate element also supports an optional surveyDate attribute that indicates the date of the map survey, if known. The desc element stores a description of the product. The optional isbn element stores the ISBN for the product. The price element stores the name of the product and supports two attributes-format, the format of the product (flat or raised) with a default of flat; and media, the media type of the product (paper or electronic). For this document, Benjamin wants to enforce a document structure to ensure that information recorded in the document is valid. Therefore, your task will be to create the DTD for the document. Complete the following: 1. Using your text editor, open the prodtxt.xml file from the xml02 review folder provided with your Data Files, enter your name and todays date in the comment section of the file, and then save the file as products.xml. comment section and before the opening <products> tag. a. The products element, containing at least one occurrence of the child element product 2. In the products.xml file, insert an internal DTD for the root element products directly after the 3. Within the internal DTD, declare the following items: b. The product element, containing five child elements in the sequence name, versionDate, desc, an optional isbn, and price c. The name, versionDate, desc, isbn, and price elements, each containing parsed character data 4. Add the following attribute declarations to the product file: a. For the name element, a required pid attribute as an ID b. For the name element, a required category attribute equal to historical, state, or parksTutorial 2 Validating Documents with DTDs | XML XML 123 . For the versionDate element, an optional surveyDate attribute containing the date of the survey d. For the price element, an optional format attribute equal to either flat or raised, with a 5. On the same line as the format attribute definition, insert a comment containing the text format 6. Save your changes to the products.xml file, and then use Exchanger XML Editor or another XML . Validate the document. If necessary, correct errors one at a time and revalidate until the default of flat e. For the price element, a required media attribute equal to either paper or electronic default is flat. tool to verify that the document is well formed. document is valid.<7xml version=1.0 encoding=UTF-8?> <! New Perspectives on XML Tutorial 2 Tutorial Case Map Finds For You report Author: Date: Filename: orders.xml - <customers> <customer custID=cust201> - <name title-Mr.>John Michael</name> - address> [CDATA 41 West Plankton Avenue Orlando, FL 32820 </address> <phone> (407) 555-3476</phone> <email </email> - <orders> - <order orderBy-cust201 orderID- or1089> くOrderDate > 8/11/2017</orderDate > - item itemNumber-WM100PL> <itemQty> 1</itemQty> -<Cem item Number= WM101P> <itemQty> 2</itemQty> - <items> kitemPrice saleItem N >39.95</itemPrice> </item> kitemPrice saleItem Y 19.90</itemPrice> </item> </items> </order> </orders> </customer> <customer custID=cust202> - <name title-Mr.>Dean Abernath</name> - address> [CDATA 200 Bear Avenue Front Royal, VA 22630 </address><phone>(540) 555-1788</phone> <email </email> - <orders> - <order orderBy-cust202 orderID-or1021> くOrderDate> 8/1/2017</orderDate> - <item itemNumber-WM1OOPL <itemQty> 1</itemQty> + <item itemNumber-WM105L> - <items> itemPrice > 29.95</itemPrice > </item> </items> </order> - <order orderBy-cust202 orderID-or1122> <orderDate 10/1/2017</orderDate> - <items> - <item itemNumber-H115E> item Price saleltem-Y> 24.90-</itemPrice > <itemQty> 2</itemQty> </item> - <item itemNumber-H115F> kitemPrice saleItem N14.95</itemPrice> <itemQty> 1</itemQty> </item> </items> </order> </orders> </customer> - <customer custID- cust203> <name> Riverfront High School</name:> - address> [CDATA 1950 West Magnolia Drive River Falls, WI 54022 </address> <phone>(715) 555-4022</phone> - <orders> - <order orderBy-cust203 orderID-or1120>Orde rDate> 9/15/20 17</orderDate> - <items> - <item itemNumber-WM140P> <itemPrice> 78.90</itemPrice> <itemQty> 2</itemQty> </item> </items> </order </orders> </customer> </customers>

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution