XML

Generate XML and XSD

Question: Generate XML and XSD from the below Entity-Relationship diagram Give all the element names in lowercase. Code: company.xml company.xsd Recommended:

Generate XSD 5

Question: <?xml version=”1.0″ encoding=”UTF-8″?> <mobilestore> <mobile> <brand>Nokia</brand> <os>Symbian</os> <model>C6</model> <ram>1gb</ram> <internal>8gb</internal> </mobile> <mobile> <brand>Samsung</brand> <os>Android</os> <model>Galaxy</model> <ram>2gb</ram> <internal>8gb</internal> </mobile> <mobile> <brand>Sony</brand> <os>Android</os> <model>Experia</model> <ram>512mb</ram> <internal>16gb</internal> </mobile> </mobilestore> Code: mobile.xsd Recommended:

Generate XSD 4

Question: 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> Code: employee.xsd Recommended:

Generate XSD 2

Question: 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>…

Generate DTD 6

Question: Generate DTD for the given XML document <?xml version=”1.0″ encoding=”UTF-8″?> <!DOCTYPE  mobilestore  SYSTEM “mobile.dtd”> <mobilestore> <mobile> <brand>Nokia</brand> <os>Symbian</os> <model>C6</model> <ram>1gb</ram> <internal>8gb</internal> </mobile> <mobile> <brand>Samsung</brand> <os>Android</os> <model>Galaxy</model> <ram>2gb</ram> <internal>8gb</internal> </mobile> <mobile> <brand>Sony</brand> <os>Android</os> <model>Experia</model> <ram>512mb</ram> <internal>16gb</internal> </mobile> </mobilestore> Code: mobile.dtd Recommended:

Generate DTD 4

Question: Generate DTD for the given XML <?xml version=”1.0″ encoding=”UTF-8″?> <!DOCTYPE  hotels  SYSTEM “food.dtd”> <breakfast_menu> <food> <name>Turfle waffles</name> <price>$5.95</price> <description>This two turfle which has 2 famous product  is with real choco and maple syrup</description> <calories>650</calories> </food> <food> <name>Strawberry Belgian Waffles</name> <price>$24.6</price> <description>Light Belgian waffles covered with strawberries and whipped cream</description> <calories>900</calories> </food> <food> <name>Berry-Berry Belgian…

Generate DTD 2

Question: Create DTD for the below XML document <?xml version=”1.0″ encoding=”UTF-8″?> <student id=”12C042″> <fName>John</fName> <lName>Nelson</lName> <plan> <courses year=”3″> <course> <name> Extensible Markup Language</name> <shortName>XML</shortName> <record> <grade>30</grade> <date>12-Jan-2017</date> </record> </course> <course> <name>Object Oriented Concepts and Unified Modeling Language</name> <shortName><![CDATA[OOP & UML]]></shortName> </course> </courses> </plan> </student> Code: studentdtd.dtd Recommended:

Generate well formed XML document 4

Question: Create XML document from the following XSD schema <?xml version=”1.0″ encoding=”UTF-8″?> <xsd:schema xmlns:xsd=”http://www.w3.org/2001/XMLSchema”>     <xsd:element name=”creditcard”>         <xsd:complexType>             <xsd:sequence>                 <xsd:element maxOccurs=”unbounded” minOccurs=”1″ name=”card” type=”type”/>             </xsd:sequence>         </xsd:complexType>…

Generate Well-formed XML document 2

Question: Generate XML for the given scenario    XYZ school wants to store the details of student and staff in a xml file. The following scenario helps in designing the XML document.   persons will be the root tag. persons will have the entry of each person with name, age, gender, address. A person can be…

x