Skip to main content

Data Formats ( XML & JSON ) XML AND JSON | Generate XSD For Breakfast Menu

 

Generate XSD For Breakfast Menu

Generate XSD for the given XML document

<?xml version="1.0" encoding="UTF-8"?>

<breakfast_menu>

<food>

<name>Turfle waffles</name>

<price>$5.95</price>

<description>This two turfle which has 2 famous product  is with real choco and maple syrup</description>

<calories>650</calories>

</food>

<food>

<name>Strawberry Belgian Waffles</name>

<price>$24.6</price>

<description>Light Belgian waffles covered with strawberries and whipped cream</description>

<calories>900</calories>

</food>

<food>

<name>Berry-Berry Belgian Waffles</name>

<price>$4.78</price>

<description>Light Belgian waffles covered with an assortment of fresh berries and whipped cream</description>

<calories>400</calories>

</food>

<food>

<name>Fried Toast</name>

<price>$7.68</price>

<description>Thick slices made from our homemade wheat dough bread</description>

<calories>250</calories>

</food>

<food>

<name>Homestyle Breakfast</name>

<price>$7.95</price>

<description>Two eggs, bacon or sausage, toast, and England popular  hash browns</description>

<calories>1500</calories>

</food>

</breakfast_menu>

Solution:


<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="breakfast_menu">
<xs:complexType>
   <xs:sequence>
<xs:element name="food" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="price" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
<xs:element name="calories" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
   </xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>


Evaluation Result:


 

Result Description

Summary of tests
*Note: All the test cases might not have same weightage
+------------------------------+
|  1  test run/ 1  test passed |
+------------------------------+

Comments

Must Read:

Course DH ASE B3 Slot3 Mock 1 Handson | RDBMS

DH ASE B3          Slot3              Mock 1                  Handson: RDBMS

Software Engineering Concepts Software Engineering Fundamentals Post-Quiz

  Software Engineering Concepts       Software Engineering Fundamentals            Post-Quiz

Accenture Mock Quiz | Part 4

  Question  31 Correct Marked out of 1.00 Flag question Question text What will be the output of the following Java code? class Test extends Throwable { } class Base extends Test {} public class Main { public static void main(String args[]) { try { throw new Base(); } catch(Test t) { System.out.println("Test Exception"); } finally { System.out.println("Finally block "); } } } Select one: a.  Complilation error : Bass calss can't extends Test b.  print-"Test Exception" c.  Complilation error: Test Class cant extends Throwable d.  print - "Test Exception" "Finally block "   Feedback The correct answer is: print - "Test Exception" "Finally block " Question  32 Correct Marked out of 1.00 Flag question Question text Which of the following statement(s) is/are TRUE? (i) In a non-correlated(independent) subquery, the subquery is always executed only onc...

Subscribe to Get's Answer by Email