Mapping Atomic Types to CLR Types
Overview
This document explains the CLR types that are used to represent XDM values in XmlPrime.
These are the types that can be used for the arguments and return types of XDM functions implemented in C# classes. See Native modules for more information.
These are also the types that are used in the TypedValueTypedValueTypedValue and ValueTypeValueTypeValueType properties on the XPathAtomicValueXPathAtomicValueXPathAtomicValue class.
The types exposed for atomic values in XmlPrime differ from those used in the System.XmlSystem.XmlSystem.Xml namespace. In some places we have used different types because the types used in the System.XmlSystem.XmlSystem.Xml namespace do not fully represent the value (for example the lack of time zones in the date and time types).
Type Mappings
In some cases more than one XDM type has the same corresponding CLR type (for example both
xs:integer
and xs:decimal
are represented
by decimalDecimaldecimal. When declaring a
native function
with a specified CLR type as an argument type or return type, the XDM type listed in
bold will be used.
Unless otherwise annotated the use of the type byteBytebyte[]
will be interpreted as a list of xs:byte
values. In order to recieve
or return xs:base64Binary
or xs:hexBinary
values
the XdmTypeAttributeXdmTypeAttributeXdmTypeAttribute must be used.