Mappage entre types de données XML et types CLR
Le tableau suivant décrit le mappage par défaut entre les types de données XML et les types CLR (common language runtime).
Notes
Les préfixes xs
et xdt
sont mappés aux URI d’espace de noms https://www.w3.org/2001/XMLSchema et https://www.w3.org/2003/05/xpath-datatypes, respectivement.
Type XML | Type 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œud Document | XPathNavigator |
Nœud d'élément | XPathNavigator |
Nœud d'attribut | XPathNavigator |
Nœud d'espace de noms | XPathNavigator |
Nœud de texte | XPathNavigator |
Nœud de commentaire | XPathNavigator |
Nœud d'instruction de traitement | XPathNavigator |
Voir aussi
Collaborer avec nous sur GitHub
La source de ce contenu se trouve sur GitHub, où vous pouvez également créer et examiner les problèmes et les demandes de tirage (pull requests). Pour plus d’informations, consultez notre guide du contributeur.
Commentaires
https://aka.ms/ContentUserFeedback.
Prochainement : Tout au long de l'année 2024, nous supprimerons progressivement les GitHub Issues en tant que mécanisme de retour d'information pour le contenu et nous les remplacerons par un nouveau système de retour d'information. Pour plus d’informations, voir:Soumettre et afficher des commentaires pour