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:

DFA Solutions

  Question  1 Correct Mark 1.00 out of 1.00 Flag question Question text To secure the http messages in the API calls, its necessary to: Select one: a. All the above b. Use cryptography c. implement identity management d. avoid hardcoding any sensitive data in the messages Feedback The correct answer is: All the above Question  2 Correct Mark 1.00 out of 1.00 Remove flag Question text A team has completed 10 Sprints and moving to the 11th Sprint. Till Sprint 10, the team has achieved an average of 50 story points per sprint. The same is projected as their velocity for the upcoming sprints with the Client. What is this approach called? Select one: a. Velocity Driven Sprint Planning b. Velocity Driven Commitment c. Commitment Driven Velocity d. Commitment Driven Sprint Planning Feedback The correct answer is: Velocity Driven Sprint Planning Question  3 Incorrect Mark 0.00 out of 1.00 Remove flag Question text Jack is grooming himself to be a potential Product Owner. Kno...

Accenture TFA MCQ | Part 2

  Question  26 Incorrect Mark 0.00 out of 1.00 Flag question Question text Go-Will department store wants to automate few of its functionalities.From the below options identify the functional requirements of Go-Will department store Select one or more: a.  Generate Bill for the purchased Items   b.  Add Product Details   c.  System should be up and running 24/7   d.  Response for each button click should be within 3 seconds   Feedback The correct answers are: Generate Bill for the purchased Items, Add Product Details Question  27 Incorrect Mark 0.00 out of 1.00 Flag question Question text A website for Flight Booking was developed and given to the testing team for testing. It has various fields to enter the data, out of which one of the input field will take the birth year from the user ranging from 1980 to 2060. The boundary values for testing this field are? Select one: a.  1959, 1960, 1994, 1995 b.  0, 1959, 1960, 1961,...

Data Formats ( XML & JSON ) XML AND JSON | Generate XSD for Students

  Generate XSD for Students   Generate XSD for the following XML. XYZ School wants to store the details of students in an xml file. The following scenario helps in designing the XML document. Here StudentList  is the root tag. StudentList contains the entry of each student with rollno, name, age, address and department. <?xml version="1.0" encoding="UTF-8"?> <StudentList  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:noNamespaceSchemaLocation="StudentList.xsd">     <Student rollno="2017CSE0055">         <name>             <firstname>Savitha</firstname>         </name>         <age>20</age>         <address>             <doorno>35</doorno>     ...

Accenture TFA MCQ | Part 1

Question  1 Correct Mark 1.00 out of 1.00 Flag question Question text   Identify whether the below statement is True or False: The hierarchy of Reader/Writer class is character-oriented and InputStream/OutputStream class is byte-oriented Select one: True   False Feedback The correct answer is 'True'. Question  2 Correct Mark 1.00 out of 1.00 Flag question Question text While garbage collection the java run time system automatically calls ______________method. Select one: a.  finalize()   b.  finalizer() c.  finally() d.  finalized() Feedback The correct answer is: finalize() Question  3 Partially correct Mark 0.67 out of 1.00 Flag question Question text Choose all the statement(s) that are valid. Select one or more: a.  There is only single copy of member function in memory when a class is loaded b.  A super class is an incomplete class that requires further specification c.  Two classes in two different packages can have ...

RDBMS Data Definition Language | Create Buses table

 efer the below schema and create the buses table. Column Name Datatype Size Constraint Constraint name Bus_no Number 11 Primary key PK_BUSES Bus_name Varchar2 20   Type Varchar2 20   Total_seats Number 11   Avail_seats Number 11     Result Description Summary of tests +------------------------------+ | 3 tests run / 3 test passed | +------------------------------+

RDBMS Data Definition Language | Create Distributor table

  Write a query to create Distributor table with constraints mentioned.  Refer the below schema  Result Description Summary of tests +------------------------------+ | 3 tests run / 3 test passed | +------------------------------+

Zero One Knapsack | Recursion

 1. You are given a number n, representing the count of items. 2. You are given n numbers, representing the values of n items. 3. You are given n numbers, representing the weights of n items. 3. You are given a number "cap", which is the capacity of a bag you've. 4. You are required to calculate and print the maximum value that can be created in the bag without       overflowing it's capacity. Note: Each item can be taken 0 or 1 number of times. You are not allowed to put the same item again and again. Input Format A number n v1 v2 .. n number of elements w1 w2 .. n number of elements A number cap Output Format A number representing the maximum value that can be created in the bag without overflowing it's capacity Constraints 1 <= n <= 20 0 <= v1, v2, .. n elements <= 50 0 < w1, w2, .. n elements <= 10 0 < cap <= 10 Sample Input 5 15 14 10 45 30 2 5 1 3 4 7 Sample Output 75 Solution: import java.io.*; import java.util.*; public class Main...

Accenture Mock Quiz | Part 1

Question  1 Incorrect Marked out of 1.00 Remove flag Question text Select the true statement ? Select one: a.  Inheritance forms a is-a part of relationship between classes.   b.  Aggregation is the stronger form of Inheritance. c.  Aggregation forms the is-a type of relationship between classes. d.  Aggregation forms a is-a part of relationship between classes. Composition is the stronger form of Aggregation. Feedback The correct answer is: Aggregation forms a is-a part of relationship between classes. Composition is the stronger form of Aggregation. Question  2 Correct Marked out of 1.00 Flag question Question text What is the diagram that depicts the interaction between objects by arranging the objects in time sequence ? Select one: a.  Use Case Diagram b.  Sequence Diagram   c.  Component Diagram d.  Activity Diagram Feedback The correct answer is: Sequence Diagram Question  3 Incorrect Marked out of 1.00 Flag question...

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