Table of Contents

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

document IXPathNavigable

The document to use

expression XPathExpression

The XPath expression to evaluate

context CustomContext

The 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

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

Returns

string

The evaluated expression result

Exceptions

ArgumentException

This is thrown if the keyValuePairs parameter contains an odd number of parameters.

Examples

string result = document.EvalXPathExpr("concat($key, '.htm')", "key", "filename");