Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

DUE TODAY MIDNIGHT USING PHPstorm9 to debug PART1 (Nutrition Information XML Doc

ID: 3762010 • Letter: D

Question

DUE TODAY MIDNIGHT

USING PHPstorm9 to debug

PART1 (Nutrition Information XML Document) Create an XML document that marks up the nutrition facts for a package of Grandma White's cookies. A package of cookies has a serving size of 1 package and the following nutritional value per serving: 260 calories, 100 fat calories, 11 grams of fat, 2 grams of saturated fat, 5 milligrams of cholesterol, 210 milligrams of sodium, 36 grams of total carbohydrates, 2 grams of fiber, 15 grams of sugars and 5 grams of protein. Name this document nutrition.xml. Load the XML document into Internet Explorer.

PART 2:Write an XML Schema document (nutrition.xsd) specifying the structure of the XML document created in Exercise 14.7.

PART 3Write an XSL style sheet for your solution to Exercise 14.7 that displays the nutritional facts in an XHTML table. Modify Fig. 14.38 to output the results.

Explanation / Answer

PART 2:

MODIFIED CODE:

XML Schema document:

<?xml version = "1.0"?>
<!-- Cookie Nutrition Info -->
<schema xmlns = "http://www.w3.org/2001/XMLSchema"
   xmlns:lawrence = "http://www.personal.kent.edu/~clawre13/ch14"
   targetNamespace = "http://www.personal.kent.edu/~clawre13/ch14">

   <simpleType name = "Quantity">
       <restriction base = "int" />
   </simpleType>
  
   <simpleType name = "Unit">
       <restriction base = "string" />
   </simpleType>
  
   <complexType name = "nutritionInfo">
       <all>
           <element name = "quantity" type = "lawrence:quantity" />
           <element name = "unit" type = "lawrence:unit" />
       </all>
   </complexType>
  
   <complexType name = "itemType">
       <all>
           <element name = "title" type = "string" />
           <element name = "servingSize" type = "lawrence:nutritionInfo" />
           <element name = "calories" type = "lawrence:nutritionInfo" />
           <element name = "fatCalories" type = "lawrence:nutritionInfo" />
           <element name = "fat" type = "lawrence:nutritionInfo" />
           <element name = "fiber" type = "lawrence:nutritionInfo" />
           <element name = "sugars" type = "lawrence:nutritionInfo" />
           <element name = "protein" type = "lawrence:nutritionInfo" />
       </all>
   </complexType>
  
   <complexType name = "itemsType">
       <all>
           <element name = "item" type = "lawrence:itemType" />
       </all>
   </complexType>
  
   <element name = "items" type = "lawrence:itemsType" />
  
</schema>