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

Subscribe to Get's Answer by Email