Mapeando tipos de dados XML para tipos CLR
A tabela a seguir descreve o mapeamento padrão entre os tipos de dados XML e os tipos CLR (Common Language Runtime).
Nota
Os xs
prefixos e são xdt
mapeados para os URIs e https://www.w3.org/2001/XMLSchema o https://www.w3.org/2003/05/xpath-datatypes namespace, respectivamente.
Tipo XML | Tipo 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:gMonth |
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 |
Nó do documento | XPathNavigator |
Nó do elemento | XPathNavigator |
Nó de atributo | XPathNavigator |
Nó do namespace | XPathNavigator |
Nó de texto | XPathNavigator |
Nó de comentário | XPathNavigator |
Nó de instruções de processamento | XPathNavigator |
Consulte também
Colabore connosco no GitHub
A origem deste conteúdo pode ser encontrada no GitHub, onde também pode criar e rever problemas e pedidos Pull. Para mais informações, consulte o nosso guia do contribuidor.