MarkLogic XCC/.Net Library

Request.SetNewVariable Method (String, ValueType, Object)

Convenience method that creates a new XdmVariable, binds it to this Request and then returns the new XdmVariable. This method is equivalent to:

            XdmVariable temp = ValueFactory.newVariable (
            ValueFactory.newXName (null, localname),
            ValueFactory.newValue (type, value));
            request.setVariable (temp);
            return temp;
            

[Visual Basic]
Function SetNewVariable( _
   ByVal localname As String, _
   ByVal type As ValueType, _
   ByVal val As Object _
) As XdmVariable
[C#]
XdmVariable SetNewVariable(
   string localname,
   ValueType type,
   object val
);

Parameters

localname
The local name as a String.
type
An instance of ValueType that indicates which specific subclass of XdmValue to instantiate.
val
An object that contains the value. The concrete type that should be passed is dependent on the ValueType instance provided as the "type" parameter.

Return Value

The newly construct XdmVariable instance.

See Also

Request Interface | Marklogic.Xcc Namespace | Request.SetNewVariable Overload List