How to use XSD Empty Element in XML

In this article I am going to explain about XSD Empty Element in XML.
  • 2364

XSD Empty Element

An XSD Empty Element is an such type of element that does not contain Contents. Its only contain attribute.


<Employee name="EmpId" />


In above example "Employee" have no content. For defined type with no content we must defined that allow element in its content.


<xs:element name="Employee">


    <xs:attribute name="EmpId" type="xs:positiveInteger"/>




For defined type we can also give the complex type element name.


<xs:element name="Employee" type="Detail"/>


<xs:complexType name="Detail">

  <xs:attribute name="Empid" type="xs:positiveInteger"/>


Further Readings

You may also want to read these related articles: here
Ask Your Question 
Got a programming related question? You may want to post your question here
© 2020 DotNetHeaven. All rights reserved.