XSD Miscellaneous Data Types |
Other miscellaneous data types are boolean, hexBinary, base64Binary,float, double, anyURI, QName, and NOTATION.
A D V E R T I S E M E N T
|
Boolean Data Type
|
The boolean data type is used to specify a true value or a false value.
The following is an example of a boolean declaration in the schema:
|
<xs:attribute name="disabled" type="xs:boolean"/>
|
|
An element in your document might look as follows:
|
<prize disabled="true">999</prize>
|
|
Note: Legal value for boolean are true, false, 1 (which indicates true), and 0 (which indicates false).
|
Binary Data Types
|
Binary data types are used to express binary-formatted data only.
We have only two binary data types:
- hexBinary (hexadecimal-encoded binary data)
- base64Binary (Base64-encoded binary data)
The following is an example of a hexBinary declaration in the schema:
|
<xs:element name="blobsrc" type="xs:hexBinary"/>
|
|
Any URI Data Type
|
The anyURI data type is used to specify URI.
The following is an example of an anyURI declaration in the schema:
|
<xs:attribute name="src" type="xs:anyURI"/>
|
|
An element in your document might look as follows:
|
<pic src="http://www.academictutorials.com/images/webform.gif" />
|
|
Note: If a URI has space, replace them with %20.
|
Miscellaneous Data Types
|
Name |
anyURI |
|
base64Binary |
|
boolean |
|
double |
|
float |
|
hexBinary |
|
NOTATION |
|
QName |
|
|
Restrictions on Miscellaneous Data Types
|
Restrictions that can be used with other data types:
- enumeration (a Boolean data type cannot use this
constraint)
- maxLength (a Boolean data type cannot use this
constraint)
- length (a Boolean data type cannot use this constraint)
- minLength (a Boolean data type cannot use this
constraint)
- pattern
- whiteSpace
|
Be the first one to comment on this page.
Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
Keywords:
XSD miscellaneous datatype,xsd data types,xsd tutorial,xsd xml,xsd dtd,xsd examples,xsd validator,sample xsd,xsd specification,xsd tools,xsd example,xml datatype,xsd format,xsd editor,xsd syntax,cdata xsd,xsd namespace,xsd schema,xsd viewer
|