MarkLogic XCC/.Net Library |

# ValueFactory.NewValue Method

Generic XdmValue creation factory method. Value types are enumerated in ValueType. Examples are ValueType.XS_INTEGER, ValueType.XS_BOOLEAN, ValueType.SEQUENCE, ValueType.XS_STRING, etc.

NOTE: If you pass a valueType of ValueType.NODE, it will be treated as ValueType.ELEMENT. Using ValueType.NODE directly is discouraged, it is defined as the common super-type for all node types. Other node types that may be constructed are ValueType.TEXT and ValueType.BINARY. In future releases, creation of additional node value types will be supported.

[Visual Basic]
Public Shared Function NewValue( _
ByVal valueType As ValueType, _
ByVal valIn As Object _
) As XdmValue
[C#]
public static XdmValue NewValue(
ValueType valueType,
object valIn
);

#### Parameters

valueType
  An concrete subclass of ValueType which indicates the type of value to create.
valIn
  A Object containing the actual value to construct the object with. The specific class of this object is be determined by the valueType argument. If the provided value is not consistent with the valueType then an exception may be thrown.

#### Return Value

An instance of XdmValue.

#### See Also

ValueFactory Class | Marklogic.Xcc Namespace