Supporto del tipo di dati tra tipi XSD (XML Schema) e tipi .NET Framework

La sezione relativa ai tipi di dati della raccomandazione XML Schema del World Wide Web Consortium (W3C) è disponibile all'indirizzo http://www.w3.org/TR/xmlschema-2 ed elenca i tipi di dati che è possibile utilizzare negli schemi XML (informazioni in lingua inglese).

Questi tipi di dati sono rappresentati come istanze della classe XmlSchemaDatatype che dispone delle proprietà ValueType e TokenizedType. Esse sono rispettivamente il nome del tipo così come viene specificato nella raccomandazione XML 1.0 e il nome del tipo .NET Framework rappresentato.

Le classi XmlSchemaElement e XmlSchemaAttribute hanno le proprietà ElementType e AttributeType contenenti un XmlSchemaDatatype per il tipo di schema XML dell'elemento o attributo dopo la convalida e compilazione dello schema.

Nella tabella che segue vengono illustrati i tipi di dati dello schema XML e i corrispondenti tipi di dati .NET Framework.

Tipo XML Schema (XSD) Tipo .NET Framework
anyURI System.Uri
base64Binary System.Byte[]
Boolean System.Boolean
Byte System.SByte
Date System.DateTime
dateTime System.DateTime
decimal System.Decimal
Double System.Double
duration System.TimeSpan
ENTITIES System.String[]
ENTITY System.String
Float System.Single
gDay System.DateTime
gMonthDay System.DateTime
gYear System.DateTime
gYearMonth System.DateTime
hexBinary System.Byte[]
ID System.String
IDREF System.String
IDREFS System.String[]
int System.Int32
integer System.Decimal
language System.String
long System.Int64
month System.DateTime
Name System.String
NCName System.String
negativeInteger System.Decimal
NMTOKEN System.String
NMTOKENS System.String[]
nonNegativeInteger System.Decimal
nonPositiveInteger System.Decimal
normalizedString System.String
NOTATION System.String
positiveInteger System.Decimal
QName System.Xml.XmlQualifiedName
short System.Int16
string System.String
time System.DateTime
timePeriod System.DateTime
token System.String
unsignedByte System.Byte
unsignedInt System.UInt32
unsignedLong System.UInt64
unsignedShort System.UInt16

Vedere anche

SOM (Schema Object Model) XML