This documentation is archived and is not being maintained.

Data Type Support between XML Schema (XSD) Types and .NET Framework Types

.NET Framework 1.1

The data types section of the World Wide Web Consortium (W3C) XML Schema Recommendation, available at http://www.w3.org/TR/xmlschema-2, lists the data types that can be used in XML Schemas.

These data types are represented as instances of the XmlSchemaDatatype class, which has ValueType and TokenizedType properties. These properties respectively are the name of the type as specified in the XML 1.0 Recommendation, and the name of the .NET Framework type that represents it.

The XmlSchemaElement and XmlSchemaAttribute classes have ElementType and AttributeType properties that contain an XmlSchemaDatatype for the XML Schema type of the element or attribute after validation and compilation of the schema.

The following table shows the XML Schema data types and their corresponding .NET Framework type support.

XML Schema (XSD) type.NET Framework type
anyURISystem.Uri
base64BinarySystem.Byte[]
BooleanSystem.Boolean
ByteSystem.SByte
DateSystem.DateTime
dateTimeSystem.DateTime
decimalSystem.Decimal
DoubleSystem.Double
durationSystem.TimeSpan
ENTITIESSystem.String[]
ENTITYSystem.String
FloatSystem.Single
gDaySystem.DateTime
gMonthDaySystem.DateTime
gYearSystem.DateTime
gYearMonthSystem.DateTime
hexBinarySystem.Byte[]
IDSystem.String
IDREFSystem.String
IDREFSSystem.String[]
intSystem.Int32
integerSystem.Decimal
languageSystem.String
longSystem.Int64
monthSystem.DateTime
NameSystem.String
NCNameSystem.String
negativeIntegerSystem.Decimal
NMTOKENSystem.String
NMTOKENSSystem.String[]
nonNegativeIntegerSystem.Decimal
nonPositiveIntegerSystem.Decimal
normalizedStringSystem.String
NOTATIONSystem.String
positiveIntegerSystem.Decimal
QNameSystem.Xml.XmlQualifiedName
shortSystem.Int16
stringSystem.String
timeSystem.DateTime
timePeriodSystem.DateTime
tokenSystem.String
unsignedByteSystem.Byte
unsignedIntSystem.UInt32
unsignedLongSystem.UInt64
unsignedShortSystem.UInt16

See Also

XML Schema Object Model (SOM)

Show: