Class XPathExpression

Assembly: redb.Route.dll

Expression for evaluating XPath queries against the message body in an .

public class XPathExpression : Expression, IPredicateExpression, IExpression

Inheritance

Object→Expression→XPathExpression

Implements

Inherited Members

Methods

Evaluate<T>(IExchange)

Evaluates the expression and returns the result cast to T.

public override T Evaluate<T>(IExchange exchange)

From(IExpression)

Returns the same expression reading source instead of the message body.

public XPathExpression From(IExpression source)

Matches(IExchange)

Evaluates the expression in a condition position.

public bool Matches(IExchange exchange)

SetValue(IExchange, object)

Sets a value in the exchange according to this expression's semantics.

public override void SetValue(IExchange exchange, object value)

ToTemplateString()

Serializes this expression to a ${...} template string suitable for URI parameters.

public override string ToTemplateString()

Trimmed(bool)

Returns the same expression with whitespace trimmed off the text it extracts.

public XPathExpression Trimmed(bool trim = true)

WithNamespaces(params (string Prefix, string Uri)[])

Returns the same expression with prefixes bound to namespace URIs, so a path can address a

public XPathExpression WithNamespaces(params (string Prefix, string Uri)[] namespaces)

WithParameters(params (string Name, IExpression Value)[])

Returns the same expression with named XPath variables bound to expressions, so a value from

public XPathExpression WithParameters(params (string Name, IExpression Value)[] parameters)

Constructors

XPathExpression(string, XPathResult)

Initializes a new instance of the class with an explicit

Remarks

Extracts data from an XML document using W3C XPath 1.0 expressions.
Supports , , string XML, and POCO bodies
(auto-serialized to XML). Optionally accepts an
for querying namespace-qualified documents.