JSON Handson-Ons | Accenture TFA Training Pre-Learning Modules
Disclaimer: The primary purpose of providing this solution is to assist and support anyone who are unable to complete these courses due to a technical issue or a lack of expertise. This website's information or data are solely for the purpose of knowledge and education.
Make an effort to understand these solutions and apply them to your Hands-On difficulties. (It is not advisable that copy and paste these solutions).
1. Generate XSD 2
Path: JSON/Generate XSD 2/hotels.xsd
<?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>
2. Generate XSD 4
Path: JSON/Generate XSD 4/employee.xsd
<?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>
3. Generate XSD For Breakfast Menu
Path: JSON/Generate XSD For Breakfast Menu/food.xsd
<?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>
4. Generate XSD For Mobile Store
Path: JSON/Generate XSD For Mobile Store/mobile.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="mobilestore">
<xs:complexType>
<xs:sequence>
<xs:element name="mobile" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="brand" type="xs:string"/>
<xs:element name="os" type="xs:string"/>
<xs:element name="model" type="xs:string"/>
<xs:element name="ram" type="xs:string"/>
<xs:element name="internal" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
5. Generate XSD for Persons
Path: JSON/Generate XSD for Persons/PersonList.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="PersonList">
<xs:complexType>
<xs:sequence>
<xs:element name="Person" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="adhaarno" type="xs:integer"/>
<xs:element name="name">
<xs:complexType>
<xs:choice>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="age" type="xs:integer"/>
<xs:element name="address">
<xs:complexType>
<xs:sequence>
<xs:element name="doorno" type="xs:integer"/>
<xs:element name="street" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
<xs:element name="pincode" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="Category" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
6. Generate XSD for Students
Path: JSON/Generate XSD for Students/StudentList.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="StudentList">
<xs:complexType>
<xs:sequence>
<xs:element name="Student" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="name">
<xs:complexType>
<xs:all>
<xs:element name="firstname" type="xs:string" minOccurs="0"/>
<xs:element name="lastname" type="xs:string" minOccurs="0"/>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="age" type="xs:integer"/>
<xs:element name="address">
<xs:complexType>
<xs:sequence>
<xs:element name="doorno" type="xs:integer"/>
<xs:element name="street" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
<xs:element name="pincode" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="department" type="xs:string"/>
</xs:sequence>
<xs:attribute name="rollno" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
If you have any queries, please feel free to ask on the comment section.If you want MCQs and Hands-On solutions for any courses, Please feel free to ask on the comment section too.Please share and support our page!
Post a Comment