Skip to main content

Data Formats ( XML & JSON ) XML AND JSON | Generate XSD 2

 

Generate XSD 2

Generate XSD for the following XML document

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

<!--  <!DOCTYPE  hotels  SYSTEM "hotel.dtd"> -->

<hotels>

<hotel>

<ID>1</ID>

<Name> TAJ GANJ </Name>

<Stars>3</Stars>

<Facilities>Restaurant,Parking,Internet</Facilities>

<Address>Taj Ganj,FFatehabad Road Agra Uttar Pradesh 282001</Address>

<Type>budget</Type>

<Available>true</Available>

</hotel>

<hotel>

<ID>2</ID>

<Name> TAJ EXOTICA </Name>

<Stars>5</Stars>

<Facilities>Indian therapies,Yoga and meditation,Spaindulges,Parking</Facilities>

<Address>CalwaddoBenaulim, Salcete Goa 403716</Address>

<Type>luxury</Type>

<Available>false</Available>

</hotel>

<hotel>

<ID>3</ID>

<Name> VIVANTA by TAJ </Name>

<Stars>3</Stars>

<Facilities>Parking,Restaurant,Internet,Chinese Restaurant, Party Lawn</Facilities>

<Address>105, Race Course Road Coimbatore TamilNadu 641018</Address>

<Type>medium luxury</Type>

<Available>true</Available>

</hotel>

<hotel>

<ID>4</ID>

<Name> TAJ DECCAN </Name>

<Stars>4</Stars>

<Facilities>Parking,Fitnesscenter,Meetingrooms,Private dining for party</Facilities>

<Address>Road No. 1, Banjara Hills Hyderabad Telangana State 500034</Address>

<Type>Budget</Type>

<Available>true</Available>

</hotel>

<hotel>

<ID>5</ID>

<Name> TAJ BEKAL RESORT </Name>

<Stars>4</Stars>

<Facilities>Spa ,Internet ,Yoga and meditation,parking,internet</Facilities>

<Address>Kappil Beach Kasargod Kerala 671319</Address>

<Type>Luxury</Type>

<Available>false</Available>

</hotel>

</hotels>

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="hotels">
<xs:complexType>
    <xs:sequence>
        <xs:element name="hotel" maxOccurs="unbounded">
            <xs:complexType>
            <xs:sequence>
            <xs:element name="ID" type="xs:int"/>
            <xs:element name="Name" type="xs:string"/>
            <xs:element name="Stars" type="xs:int"/>
            <xs:element name="Facilities" type="xs:string"/>
            <xs:element name="Address" type="xs:string"/>
            <xs:element name="Type" type="xs:string"/>
            <xs:element name="Available" type="xs:string"/>
            </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:

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...

Coin Change Combination

1. You are given a number n, representing the count of coins. 2. You are given n numbers, representing the denominations of n coins. 3. You are given a number "amt". 4. You are required to calculate and print the number of combinations of the n coins using which the       amount "amt" can be paid. Note 1: You have an infinite supply of each coin denomination i.e. same coin denomination can be                    used for many installments in payment of "amt" Note 2: You are required to find the count of combinations and not permutations i.e.                   2 + 2 + 3 = 7 and 2 + 3 + 2 = 7 and 3 + 2 + 2 = 7 are different permutations of same                    combination. You should treat them as 1 and not 3. Input Format A number n n1 n2 .. n number of elements A number amt Output Format A number representing the count of ...

Programming using Java Hands On - Control Structures | Check for Leap Year

  Given a year, check if the year is leap year or not.  If yes, the output should be “Leap Year”.  Else output should be “Not a Leap Year”.  The input should be a positive four digit number.  Else,  the output should be “Invalid Year”. Sample Input  1 : Enter the Year 2016 Sample Output  1 : Leap Year Sample Input  2 : Enter the Year 2001 Sample Output  2 : Not a Leap Year Result Description Summary of tests *Note: All the test cases might not have same weightage +------------------------------+ | 12 tests run/12 tests passed | +------------------------------+

Climb Stairs With Minimum Moves

1. You are given a number n, representing the number of stairs in a staircase. 2. You are on the 0th step and are required to climb to the top. 3. You are given n numbers, where ith element's value represents - till how far from the step you       could jump to in a single move.  You can of-course fewer number of steps in the move. 4. You are required to print the number of minimum moves in which you can reach the top of       staircase. Note -> If there is no path through the staircase print null. Input Format A number n .. n more elements Output Format A number representing the number of ways to climb the stairs from 0 to top. Constraints 0 <= n <= 20 0 <= n1, n2, .. <= 20 Sample Input 10 3 3 0 2 1 2 4 2 0 0 Sample Output 4 Solution: import java.io.*; import java.util.*; public class Main {     public static void main(String[] args) throws Exception {         // write your code here    ...

Subscribe to Get's Answer by Email