BuildComponentUtilities.EvalXPathExpr Method
Definition
- Namespace
- Sandcastle.Core.BuildAssembler
- Assembly
- Sandcastle.Core.dll
EvalXPathExpr(IXPathNavigable, XPathExpression, CustomContext)
This is used to get the string result from evaluating an XPath expression against the given document and context.
public static string EvalXPathExpr(this IXPathNavigable document, XPathExpression expression, CustomContext context)
Parameters
documentIXPathNavigableThe document to use
expressionXPathExpressionThe XPath expression to evaluate
contextCustomContextThe context to use
Returns
- string
The evaluated expression result
EvalXPathExpr(IXPathNavigable, XPathExpression, params string[])
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.
public static string EvalXPathExpr(this IXPathNavigable document, XPathExpression expression, params string[] keyValuePairs)
Parameters
documentIXPathNavigableThe document to use
expressionXPathExpressionThe XPath expression to evaluate
keyValuePairsstring[]A set of key/value pairs to use when creating the context
Returns
- string
The evaluated expression result
Exceptions
- ArgumentException
This is thrown if the
keyValuePairsparameter contains an odd number of parameters.
Examples
string result = document.EvalXPathExpr("concat($key, '.htm')", "key", "filename");