Tutorials References Exercises Videos Menu
Create Website Get Certified Upgrade

XML Tutorial

XML HOME XML Introduction XML How to use XML Tree XML Syntax XML Elements XML Attributes XML Namespaces XML Display XML HttpRequest XML Parser XML DOM XML XPath XML XSLT XML XQuery XML XLink XML Validator XML DTD XML Schema XML Server XML Examples XML Quiz XML Certificate

XML AJAX

AJAX Introduction AJAX XMLHttp AJAX Request AJAX Response AJAX XML File AJAX PHP AJAX ASP AJAX Database AJAX Applications AJAX Examples

XML DOM

DOM Introduction DOM Nodes DOM Accessing DOM Node Info DOM Node List DOM Traversing DOM Navigating DOM Get Values DOM Change Nodes DOM Remove Nodes DOM Replace Nodes DOM Create Nodes DOM Add Nodes DOM Clone Nodes DOM Examples

XPath Tutorial

XPath Introduction XPath Nodes XPath Syntax XPath Axes XPath Operators XPath Examples

XSLT Tutorial

XSLT Introduction XSL Languages XSLT Transform XSLT <template> XSLT <value-of> XSLT <for-each> XSLT <sort> XSLT <if> XSLT <choose> XSLT Apply XSLT on the Client XSLT on the Server XSLT Edit XML XSLT Examples

XQuery Tutorial

XQuery Introduction XQuery Example XQuery FLWOR XQuery HTML XQuery Terms XQuery Syntax XQuery Add XQuery Select XQuery Functions

XML DTD

DTD Introduction DTD Building Blocks DTD Elements DTD Attributes DTD Elements vs Attr DTD Entities DTD Examples

XSD Schema

XSD Introduction XSD How To XSD <schema> XSD Elements XSD Attributes XSD Restrictions XSD Complex Elements XSD Empty XSD Elements-only XSD Text-only XSD Mixed XSD Indicators XSD <any> XSD <anyAttribute> XSD Substitution XSD Example

XSD Data Types

XSD String XSD Date/Time XSD Numeric XSD Misc XSD Reference

Web Services

XML Services XML WSDL XML SOAP XML RDF XML RSS

References

DOM Node Types DOM Node DOM NodeList DOM NamedNodeMap DOM Document DOM Element DOM Attribute DOM Text DOM CDATA DOM Comment DOM XMLHttpRequest DOM Parser XSLT Elements XSLT/XPath Functions

XSD Numeric Data Types


Decimal data types are used for numeric values.


Decimal Data Type

The decimal data type is used to specify a numeric value.

The following is an example of a decimal declaration in a schema:

<xs:element name="price" type="xs:decimal"/>

An element in your document might look like this:

<price>999.50</price>

Or it might look like this:

<price>+999.5450</price>

Or it might look like this:

<price>-999.5230</price>

Or it might look like this:

<price>0</price>

Or it might look like this:

<price>14</price>


Integer Data Type

The integer data type is used to specify a numeric value without a fractional component.

The following is an example of an integer declaration in a schema:

<xs:element name="price" type="xs:integer"/>

An element in your document might look like this:

<price>999</price>

Or it might look like this:

<price>+999</price>

Or it might look like this:

<price>-999</price>

Or it might look like this:

<price>0</price>

Numeric Data Types

Note that all of the data types below derive from the Decimal data type (except for decimal itself)!

Name Description
byte A signed 8-bit integer
decimal A decimal value
int A signed 32-bit integer
integer An integer value
long A signed 64-bit integer
negativeInteger An integer containing only negative values (..,-2,-1)
nonNegativeInteger An integer containing only non-negative values (0,1,2,..)
nonPositiveInteger An integer containing only non-positive values (..,-2,-1,0)
positiveInteger An integer containing only positive values (1,2,..)
short A signed 16-bit integer
unsignedLong An unsigned 64-bit integer
unsignedInt An unsigned 32-bit integer
unsignedShort An unsigned 16-bit integer
unsignedByte An unsigned 8-bit integer

Restrictions on Numeric Data Types

Restrictions that can be used with Numeric data types:

  • enumeration
  • fractionDigits
  • maxExclusive
  • maxInclusive
  • minExclusive
  • minInclusive
  • pattern
  • totalDigits
  • whiteSpace