Class DocumentBuilder
Class DomDestination
Class DynamicContext
Class DynamicError
Class EmptyEnumerator
Class ExtensionFunctionCall
Class InvalidityHandlerWrapper
Class NamespaceConstant
Class NullDestination
Class Processor
Class QName
Class SchemaManager
Class SchemaValidator
Class Serializer
Class StandardLogger
Class StaticContext
Class StaticError
Class TextWriterDestination
Class WhitespacePolicy
Class XPathCompiler
Class XPathExecutable
Class XPathSelector
Class XQueryCompiler
Class XQueryEvaluator
Class XQueryExecutable
Class XdmAnyFunctionType
Class XdmAnyItemType
Class XdmAnyNodeType
Class XdmArray
Class XdmAtomicType
Class XdmAtomicValue
Class XdmDestination
- Class TreeProtector
Class XdmEmptySequence
Class XdmExternalObjectValue
Class XdmFunctionItem
Class XdmItem
Class XdmItemType
Class XdmMap
Class XdmNode
Class XdmNodeKind
Class XdmSequenceType
Class XdmValue
Class XmlDestination
Class Xslt30Transformer
Class XsltCompiler
Class XsltExecutable
- Class ParameterDetails
Class XsltPackage
Class XsltTransformer
Enum RecoveryPolicy
Enum SchemaValidationMode
Enum TreeModel
Enum XdmAxis
Interface IInvalidityHandler
Interface IMessageListener
Interface IQueryResolver
Interface IResultDocumentHandler
Interface IXdmEnumerator
Interface IXmlLocation
Interface SchemaResolver
public class XdmAtomicValue
The class XdmAtomicValue
represents an item in an XPath 2.0 sequence
that is an atomic value. The value may belong to any of the 19 primitive types
defined in XML Schema, or to a type derived from these primitive types, or to
the XPath 2.0 type xs:untypedAtomic
Note that there is no guarantee that every XdmValue
comprising a single
atomic value will be an instance of this class. To force this, use the Simplify
property of the XdmValue
.
Constructor Summary | |
---|---|
XdmAtomicValue(string str)
Construct an atomic value of type |
|
XdmAtomicValue(long i)
Construct an atomic value of type |
|
XdmAtomicValue(System.Byte i)
Construct an atomic value of type |
|
XdmAtomicValue(decimal d)
Construct an atomic value of type |
|
XdmAtomicValue(float f)
Construct an atomic value of type |
|
XdmAtomicValue(double d)
Construct an atomic value of type |
|
XdmAtomicValue(bool b)
Construct an atomic value of type |
|
XdmAtomicValue(System.Uri u)
Construct an atomic value of type |
|
XdmAtomicValue(QName q)
Construct an atomic value of type |
|
XdmAtomicValue(string lexicalForm, QName type, Processor processor) Construct an atomic value of a given built-in or user-defined type |
Property Summary | |
---|---|
Object |
Value Get the value as a CLI object of the nearest equivalent type. |
Method Summary | |
---|---|
bool |
IsAtomic() Determine whether the item is an atomic value |
static XdmAtomicValue |
WrapExternalObject(object external) Create an atomic value that wraps an external object. Such values can be used in conjunction with extension functions. |
static XdmAtomicValue |
MakeAtomicValue(object value) |
bool |
GetBooleanValue() Get the value converted to a boolean using the XPath casting rules |
long |
GetLongValue() Get the value converted to a boolean using the XPath casting rules |
double |
GetDoubleValue() Get the value converted to a double using the XPath casting rules. If the value is a string, the XSD 1.1 rules are used, which means that the string "+INF" is recognised. |
Decimal |
GetDecimalValue() Get the value converted to a decimal using the XPath casting rules |
String |
ToString() Convert the atomic value to a string |
Boolean |
Equals(object ) Compare two atomic values for equality |
int |
GetHashCode() Get a hash code to support equality comparison |
QName |
GetTypeName(Processor processor) |
QName |
GetPrimitiveTypeName() Get the name of the primitive type of the value |
Constructor Detail |
---|
public XdmAtomicValue(string str)
Construct an atomic value of type xs:string
str
-
public XdmAtomicValue(long i)
Construct an atomic value of type xs:integer
i
-
public XdmAtomicValue(System.Byte i)
Construct an atomic value of type xs:integer
i
-
public XdmAtomicValue(decimal d)
Construct an atomic value of type xs:decimal
d
-
public XdmAtomicValue(float f)
Construct an atomic value of type xs:float
f
-
public XdmAtomicValue(double d)
Construct an atomic value of type xs:double
d
-
public XdmAtomicValue(bool b)
Construct an atomic value of type xs:boolean
b
-
public XdmAtomicValue(System.Uri u)
Construct an atomic value of type xs:anyURI
u
-
public XdmAtomicValue(QName q)
Construct an atomic value of type xs:QName
q
-
public XdmAtomicValue(string lexicalForm, QName type, Processor processor)
Construct an atomic value of a given built-in or user-defined type
Parameters:lexicalForm
-
type
-
SchemaManager
.
processor
-
Processor
object. This is needed for looking up user-defined
types, and also because some conversions are context-sensitive, for example they depend
on the
implicit timezone or the choice of XML 1.0 versus XML 1.1 for validating names.
ArgumentException
- Thrown if the type is unknown or unsuitable, or if the supplied string is not
a valid lexical representation of a value of the given type.
Property Detail |
---|
public Object Value {get; }
Get the value as a CLI object of the nearest equivalent type.
The return type is as follows:
xs:string - String
xs:integer - Long
xs:decimal - Decimal
xs:double - Double
xs:float - Float
xs:boolean - Bool
xs:QName - QName
xs:anyURI - Uri
xs:untypedAtomic - String
wrapped external object - the original external object
Other types - currently String, but this may change in the future
Method Detail |
---|
Create an atomic value that wraps an external object. Such values can be used in conjunction with extension functions.
This method should not be used to create simple atomic values representing strings, numbers, booleans, and so on. For that purpose, use the relevant constructor. Wrapped external objects are used only when calling .NET native code external to a query or stylesheet.
In releases prior to 9.2, this method also existed with the alternative spelling
wrapExternalObject
(lower-case "w"). This was retained for backwards compatibility,
but caused problems for Visual Basic users, where it is not permitted to have two
methods whose
names differ only in case. Any applications using wrapExternalObject
must
therefore be changed to use WrapExternalObject
. Apologies for the inconvenience.
external
-
Get the value converted to a boolean using the XPath casting rules
Get the value converted to a boolean using the XPath casting rules
Get the value converted to a double using the XPath casting rules.
If the value is a string, the XSD 1.1 rules are used, which means that the string "+INF" is recognised.
Get the value converted to a decimal using the XPath casting rules
Convert the atomic value to a string
Compare two atomic values for equality
Get a hash code to support equality comparison
Get the name of the primitive type of the value
xs:untypedAtomic
. For the purposes of this method, xs:integer
is considered
to be a primitive type.
Determine whether the item is an atomic value