Skip to main content

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

 

Generate XSD 4

Generate an XSD for the following XML document

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

<company>

<employee>

<id>101</id>

<name>Ram</name>

<salary>10000</salary>

<email>ram@gmail.com</email>

</employee>

<employee>

<id>102</id>

<name>Dinesh</name>

<salary>20000</salary>

<email>dinesh@gmail.com</email>

</employee>

<employee>

<id>103</id>

<name>sathish</name>

<salary>20000</salary>

<email>sathish@gmail.com</email>

</employee>

<employee>

<id>104</id>

<name>Praveen</name>

<salary>20000</salary>

<email>praveen@gmail.com</email>

</employee>

</company>



<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="company">
<xs:complexType>
    <xs:sequence>
        <xs:element name="employee" maxOccurs="unbounded">
            <xs:complexType>
            <xs:sequence>
            <xs:element name="id" type="xs:int"/>
            <xs:element name="name" type="xs:string"/>
            <xs:element name="salary" type="xs:int"/>
            <xs:element name="email" 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:

RDBMS Data Definition Language | Create Sales_info table

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

Zig Zag Pattern

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

Logic Development | Object Oriented Programming Pre Quiz

 

RDBMS Data Definition Language | Alter - Add CHECK constraint to Mobile_Master

RDBMS  Data Definition Language  Alter - Add CHECK constraint to Mobile_Master Refer the following schema and add a constraint CHK_WARRANTY in Mobile_Master table to ensure that the warranty in years is greater than zero. Evaluation Result: Result Description Summary of tests +------------------------------+ | 3 tests run / 3 test passed | +------------------------------+

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

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

UNIX Introduction to Unix | Post-Quiz

 UNIX  Introduction to Unix  Post-Quiz  Feedback Congratulations! You have passed by securing more that 80%. Question  1 Correct Mark 1.00 out of 1.00 Flag question Question text  What is the default maximum number of processes that can exist in Unix? Select one: a.  unlimited b.   32768           c.   4096        d.  1024          Feedback Your answer is correct. The correct answer is:  32768         Question  2 Correct Mark 1.00 out of 1.00 Flag question Question text Single user mode shell has _____ prompt.  Select one: a.   $ Normal user  b.  % Admin user c.  ~ Home user d.  # Root user    Feedback Your answer is correct. The correct answer is: # Root user  Question  3 Correct Mark 1.00 out of 1.00 Flag question Question text Predict the output for the following...

Count A+b+c+ Subsequences

 1. You are given a string str. 2. You are required to calculate and print the count of subsequences of the nature a+b+c+. For abbc -> there are 3 subsequences. abc, abc, abbc For abcabc -> there are 7 subsequences. abc, abc, abbc, aabc, abcc, abc, abc. Input Format A string str Output Format count of subsequences of the nature a+b+c+ Constraints 0 < str.length <= 10 Sample Input abcabc Sample Output 7 Solution: import java.io.*; import java.util.*; public class Main {     public static void main(String[] args) throws Exception {         Scanner sc = new Scanner(System.in);         String str = sc.nextLine();         int counta = 0, countb = 0, countc = 0;         for(int i=0;i<str.length();i++){             char ch = str.charAt(i);             if(ch == 'a')                 ++coun...

Accenture Mock Quiz | Part 5

Question  40 Correct Marked out of 1.00 Flag question Question text Which of the following attribute is used by a HTML tag to apply inline style? Choose most appropriate option. Select one: a.  style   b.  id c.  styleclass d.  class Feedback The correct answer is: style Question  41 Correct Marked out of 1.00 Flag question Question text Identify the CORRECT statements with respect to CSS. a) CSS is used for giving style for HTML content b) External style sheet can be used only for one HTML page in a website Choose most appropriate option. Select one: a.  only a   b.  only b c.  neither a nor b d.  both a and b Feedback The correct answer is: only a Question  42 Correct Marked out of 1.00 Flag question Question text Which of the following statements is TRUE for CSS? A. An external style sheet is ideal when the style is applied to many pages B. An inline style created for a html tag can be reused for other tags in same page...

Subscribe to Get's Answer by Email