Saxon API for .NET

XdmAtomicValue Constructor (String, QName, Processor)

Construct an atomic value of a given built-in or user-defined type

public XdmAtomicValue(
   string lexicalForm,
   QName type,
   Processor processor
);

Parameters

lexicalForm
The string representation of the value (any value that is acceptable in the lexical space, as defined by XML Schema Part 2). Whitespace normalization as defined by the target type will be applied to the value.
type
The QName giving the name of the target type. This must be an atomic type, and it must not be a type that is namespace-sensitive (QName, NOTATION, or types derived from these). If the type is a user-defined type then its definition must be present in the schema cache maintained by the SchemaManager.
processor
The 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.

Exceptions

Exception TypeCondition
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.

Example

AtomicValue("abcd", QName.XDT_UNTYPED_ATOMIC)

creates an untyped atomic value containing the string "abcd"

See Also

XdmAtomicValue Class | Saxon.Api Namespace | XdmAtomicValue Constructor Overload List