ExpressionEval.EvalXML

Ee825317.c++_on(en-US,CS.10).gifEe825317.vb_off(en-US,CS.10).gif

Use this method to evaluate an expression represented as an Extensible Markup Language (XML) fragment.

Definition

Function EvalXML(bstrXMLExpr As String,DictObjs As Object) As Variant

Parameters

btrXMLExpr

[in] A String that contains the XML fragment to be evaluated.

DictObjs

[in] A Dictionary object that contains a set of profiles.

Return Values

This method returns a Variant indicating the results of evaluating the expression in the specified context. This result may be True, False, or Nothing. Nothing indicates the expression could not be evaluated.

Error Values

This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to either standard or custom COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.

The following table shows the custom COM errors that this method can return.

Constant Value Description
E_EXPR_BADARGTYPE &H81100018 Argument datatype information missing from expression, or unrecognized argument data type encountered in expression
E_EXPR_BADARGVALUE &H81100022 Invalid expression argument value, or impossible conversion
E_EXPR_BADCLAUSE &H81100016 Invalid clause encountered
E_EXPR_BADCONNECTION &H8110001F Invalid connection
E_EXPR_BADOPER &H81100017 Operator missing, unrecognized operator encountered, or type mismatch
E_EXPR_BADTERM &H81100015 Term type missing, or unrecognized term type encountered
E_EXPR_BADXML &H81100014 An unrecognized XML element was encountered
E_EXPR_NOCONNECTIONSTRING &H8110000D No connection string specified
E_EXPR_XMLPARSE &H81100013 XML DOM object parsing error

Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

Remarks

The XML is parsed before being evaluated. For information on the XML format, see Expression XML Structures.

Expressions evaluated with the EvalXML method are not persistent; that is, they are not stored in the expression store or loaded into the expression cache. Use the Eval method to evaluate persistent expressions.

A new ExprEvalContext object is created and then discarded for each XML fragment that is evaluated.

The Connect method must be called before using the EvalXML method.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

Example

' sXMLExpr is a string.
' Note that this string is not formatted properly with respect to
' quotation marks or continuation in order to increase readability.

strXMLExpr = "<CLAUSE OPER="equal">
                  <PROPERTY ID="User.firstName" TYPE="string" />
                  <IMMED-VAL TYPE="string">Jill</IMMED-VAL>
              </CLAUSE>"

' vResult is a Variant
' dictProfiles is a Dictionary object containing a set of profiles

vResult = oExpressionEval.EvalXML(sXMLExpr, dictProfiles)

See Also

Expression Recordset

Expression XML Structures

ExpressionEval Object

ExpressionEval.Connect

ExpressionEval.Eval

ExpressionEval.ParseXML


All rights reserved.