Поделиться через


Сопоставление типов XML-данных с типами CLR

Обновлен: November 2007

В следующей таблице описывается сопоставление по умолчанию между типами данных XML и типами данных среды CLR.

В следующей таблице описывается сопоставление по умолчанию между типами данных XML и типами CLR.

xa669bew.alert_note(ru-ru,VS.90).gifПримечание.

Префиксы xs и xdt сопоставляются с URI-кодами пространств имен http://www.w3.org/2001/XMLSchema и http://www.w3.org/2003/05/xpath-datatypes соответственно.

Тип XML

Тип CLR

xs:anyURI

Uri

xs:base64Binary

Byte[]

xs:boolean

Boolean

xs:byte

SByte

xs:date

DateTime

xs:dateTime

DateTime

xs:decimal

Decimal

xs:double

Double

xs:duration

TimeSpan

xs:ENTITIES

String[]

xs:ENTITY

String

xs:float

Single

xs:gDay

DateTime

xs:gMonthDay

DateTime

xs:gYear

DateTime

xs:gYearMonth

DateTime

xs:hexBinary

Byte[]

xs:ID

String

xs:IDREF

String

xs:IDREFS

String[]

xs:int

Int32

xs:integer

Decimal

xs:language

String

xs:long

Int64

xs:gMmonth

DateTime

xs:Name

String

xs:NCName

String

xs:negativeInteger

Decimal

xs:NMTOKEN

String

xs:NMTOKENS

String[]

xs:nonNegativeInteger

Decimal

xs:nonPositiveInteger

Decimal

xs:normalizedString

String

xs:NOTATION

XmlQualifiedName

xs:positiveInteger

Decimal

xs:QName

XmlQualifiedName

xs:short

Int16

xs:string

String

xs:time

DateTime

xs:token

String

xs:unsignedByte

Byte

xs:unsignedInt

UInt32

xs:unsignedLong

UInt64

xs:unsignedShort

UInt16

xdt:dayTimeDuration

TimeSpan

xdt:yearMonthDuration

TimeSpan

xdt:untypedAtomic

String

xdt:anyAtomicType

Object

xs:anySimpleType

String

Узел документа

XPathNavigator

Узел элемента

XPathNavigator

Узел атрибута

XPathNavigator

Узел пространства имен

XPathNavigator

Текстовый узел

XPathNavigator

Узел комментария

XPathNavigator

Узел инструкции по обработке

XPathNavigator

См. также

Другие ресурсы

Поддержка типов в классах System.Xml