Build Component UtilitiesEval XPath Expr(IXPath Navigable, XPath Expression, String) Method
This is used to get the string result from evaluating an XPath expression against the given document
and a context created from a set of key/value pairs.
Definition
Namespace: Sandcastle.Core.BuildAssembler
Assembly: Sandcastle.Core (in Sandcastle.Core.dll) Version: 2026.1.20.0
The evaluated expression result
Assembly: Sandcastle.Core (in Sandcastle.Core.dll) Version: 2026.1.20.0
C#
public static string EvalXPathExpr(
this IXPathNavigable document,
XPathExpression expression,
params string[] keyValuePairs
)VB
<ExtensionAttribute>
Public Shared Function EvalXPathExpr (
document As IXPathNavigable,
expression As XPathExpression,
ParamArray keyValuePairs As String()
) As StringC++
public:
[ExtensionAttribute]
static String^ EvalXPathExpr(
IXPathNavigable^ document,
XPathExpression^ expression,
... array<String^>^ keyValuePairs
)F#
[<ExtensionAttribute>]
static member EvalXPathExpr :
document : IXPathNavigable *
expression : XPathExpression *
keyValuePairs : string[] -> string Parameters
- document IXPathNavigable
- The document to use
- expression XPathExpression
- The XPath expression to evaluate
- keyValuePairs String
- A set of key/value pairs to use when creating the context
Return Value
StringThe evaluated expression result
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type IXPathNavigable. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).Example
C#
string result = document.EvalXPathExpr("concat($key, '.htm')", "key", "filename");Exceptions
| ArgumentException | This is thrown if the keyValuePairs parameter contains an odd number of parameters. |