Saxon.Api
Class Step<TInput, TResult>
-
public class Step<TInput, TResult>
A Step
class wraps a delegate method that can be applied to an item
to return a XdmValue
of items.
Constructor Summary |
|
---|---|
Step (Func<TInput, IEnumerable<TResult>> f) Constructor method to wrap a delegate method. |
Property Summary |
|
---|---|
Func
The |
Method Summary |
|
---|---|
Step<TInput, TResult> | At(int index)
Obtain a |
Step<TInput, TResult> | Cat(Step<TInput, TResult> other)
Obtain a |
IEnumerable<TResult> | Invoke(TInput item) Invokes this function to the given argument. |
Step<TInput, TResult> | Then(Step<TResult, TResult> next)
Obtain a |
Step<TInput, TResult> | Where(IPredicate<TResult> predicate)
Obtain a For example, |
Constructor Detail
Step
Constructor method to wrap a delegate method.
Parameters:
f
- Passes a delegate as a Func
with encapsulated type XdmItem
and the return value IEnumerable
of items.Property Detail
Func
The Func
property that represents the wrapped delegate method which can be invoked.
Method Detail
Cat
Obtain a Step
that concatenates the results of this Step
with the result of another
Step
applied to the same input item.
For example, Attribute().Cat(Child())
returns a step whose effect is
to select the attributes of a supplied element followed by its children.
Parameters:
other
- The step whose results will be concatenated with the results of this stepReturns:
Step
(that is, a function from one IEnumerable
of items to another) that
concatenates the results of applying this step to the input item, followed by the
results of applying the other step to the input item.Invoke
Invokes this function to the given argument.
Parameters:
item
- The function argumentReturns:
Then
Obtain a Step
that combines the results of this step with the results of another step.
Parameters:
next
- The step which will be applied to the results of this stepReturns:
Step
(that is, a function from one IEnumerable
of items to another) that
performs this step and the next step in turn. The result is equivalent to the IEnumerable
method SelectMany()
function or the XPath !
operator: there is no sorting of nodes into document order, and
no elimination of duplicates.Where
Obtain a Step
that filters the results of this Step
using a supplied Func
predicate.
For example, Child.Where(Predicate.IsText())
returns a Step
whose effect is to select the text node children
of a supplied element or document node.
Parameters:
predicate
- The predicate is a Func
delegate enapsulating the filter which will be applied to the results of this Step
Returns:
Step
(that is, a wrapped delegate from one Step
of items to another) that
filters the results of this step by selecting only the items that satisfy the predicate.
Obtain a
Step
that selects the Nth item in the results of this step.Parameters:
index
- The zero-based index of the item to be selectedReturns:
Step
(that is, a function from oneIEnumerable
of items to another) that filters the results of this step by selecting only the items that satisfy the predicate.