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:

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

Web Technology HTML 5 HTML 2 | Quiz 2

 Web Technology       HTML 5            HTML 2               Quiz 2

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

Logic Development | Object Oriented Programming Pre Quiz

 

Unbounded Knapsack

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 any number of times. You are 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 100 Solution: im...

Count Binary Strings

1. You are given a number n. 2. You are required to print the number of binary strings of length n with no consecutive 0's. Note: In this problem, you are given a number n. All we need to print is the number of binary strings of length n with no consecutive 0's For example: Sample Input: 3 Sample Output: 5 How 5? We have a total of eight binary numbers for length 3, out of which we have 5 numbers in which there are no consecutive zeros. Input Format A number n Output Format A number representing the number of binary strings of length n with no consecutive 0's. Constraints 0 < n <= 45 Sample Input 6 Sample Output 21 Solution: import java.io.*; import java.util.*; public class Main{ public static void main(String[] args) throws Exception {     // write your code here     Scanner sc = new Scanner(System.in);     int n = sc.nextInt();          int dp[][] = new int[n+1][2];     dp[1][0] = 1;     dp[1][1] ...

Zig Zag Pattern

  /* @ToDo     Zig Zag Pattern         *               *                *       *       *       *        *               *               *        */ #include   <iostream> using   namespace   std ; int   main (){       #ifndef  ONLINE_JUDGE          freopen ( "../asset/input.txt" , "r" , stdin );          freopen (...

Pyramid

/*  To Print  1    2   2    3   3   3    4   4   4   4    5   5   5   5   5    */ #include   <iostream> using   namespace   std ; int   main (){       #ifndef  ONLINE_JUDGE          freopen ( "../asset/input.txt" , "r" , stdin );          freopen ( "../asset/output.txt" , "w" , stdout );     #endif     // Code here!!      int   n ;  cin >> n ;      for ( int   i = 1 ; i <= n ; i ++){          for ( int   j = 1 ; j <=  i ; j ++){     ...

Data Formats ( XML & JSON ) XML AND JSON | Post-Quiz

  Question   1 Correct Mark 1.00 out of 1.00 Flag question Question text State True or False. JSON is data oriented and does not provide display capabilities. Select one: True   False Feedback The correct answer is 'True'. Question  2 Incorrect Mark 0.00 out of 1.00 Flag question Question text Which one of the following indicators define that either one of the child element must occur within the element? Select one: choice sequence      all any Feedback Your answer is incorrect. The correct answer is: choice Question  3 Correct Mark 1.00 out of 1.00 Flag question Question text JSON object value is accessed by using ________. Select one: dot(.) notation   star(*) notation colon(:) notation dollar($) notation Feedback Your answer is correct. The correct answer is: dot(.) notation Question  4 Correct Mark 1.00 out of 1.00 Flag question Question text Which of the following is a well formed XML document? Select one: <?xml version=”1.0...

Subscribe to Get's Answer by Email