Programming Pandit

c/c++/c#/Javav/Python


Latest Update

Tuesday, September 13, 2022

To write a program to create XML Schema document

employee.xsd :


<?xml version="1.0"?>  


<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"  targetNamespace="http://www.javatpoint.com"  xmlns="http://www.javatpoint.com"   elementFormDefault="qualified">  

  

<xs:element name="employee">  


  <xs:complexType>  

    <xs:sequence>  

      <xs:element name="firstname" type="xs:string"/>  

      <xs:element name="lastname" type="xs:string"/>  

      <xs:element name="email" type="xs:string"/>  

    </xs:sequence>  

  </xs:complexType>  


  </xs:element>  

  </xs:schema>  



employee.xml


<?xml version="1.0"?>  

<employee  xmlns="http://www.javatpoint.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="employee.xsd">  

   <firstname>vimal</firstname>  

  <lastname>jaiswal</lastname>  

  <email>vimal@javatpoint.com</email>  


  </employee>  

No comments:

Post a Comment