Jump to content

How to define an element which can be left blank?


Guest padukka
 Share

Recommended Posts

Yes. By defining an xs:restriction (with whatever is the original base type) that uses the xs:minLength element with a value of 0. Read more about Schema's restrictions if you didn't understand what I just said.

Link to comment
Share on other sites

  • 1 month later...

You can use <restriction> mark up to do the same.Here is the code...Assuming you know some basics of XML Schema.

<xs:element name="example">	  <xs:simpleType>			  <xs:restriction>					 <xs:maxLength value="0"/>			  </xs:restriction>	  </xs:simpleType></xs:element>

element tag: use to define element name.simpleType tag: use to define element with no child element and no attributes.restriction tag: use to put some constraint on value of element.maxLength tag: they are like Methods which can handle value of the element.nJoy your work...Always!!! :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...