pub enum Transform<N: Node> {
Show 68 variants Root, ContextItem, Compose(Vec<Transform<N>>), Step(NodeMatch), Filter(Box<Transform<N>>), Empty, Literal(Rc<Item<N>>), LiteralElement(QualifiedName, Box<Transform<N>>), Element(Box<Transform<N>>, Box<Transform<N>>), LiteralAttribute(QualifiedName, Box<Transform<N>>), LiteralComment(Box<Transform<N>>), LiteralProcessingInstruction(Box<Transform<N>>, Box<Transform<N>>), SequenceItems(Vec<Transform<N>>), Copy(Box<Transform<N>>, Box<Transform<N>>), DeepCopy(Box<Transform<N>>), Or(Vec<Transform<N>>), And(Vec<Transform<N>>), GeneralComparison(Operator, Box<Transform<N>>, Box<Transform<N>>), ValueComparison(Operator, Box<Transform<N>>, Box<Transform<N>>), Concat(Vec<Transform<N>>), Range(Box<Transform<N>>, Box<Transform<N>>), Arithmetic(Vec<ArithmeticOperand<N>>), Loop(Vec<(String, Transform<N>)>, Box<Transform<N>>), Switch(Vec<(Transform<N>, Transform<N>)>, Box<Transform<N>>), ForEach(Option<Grouping<N>>, Box<Transform<N>>, Box<Transform<N>>), ApplyTemplates(Box<Transform<N>>), ApplyImports, NextMatch, Union(Vec<Transform<N>>), Call(Box<Transform<N>>, Vec<Transform<N>>), VariableDeclaration(String, Box<Transform<N>>, Box<Transform<N>>), VariableReference(String), SetAttribute(QualifiedName, Box<Transform<N>>), Position, Last, Count(Box<Transform<N>>), LocalName(Option<Box<Transform<N>>>), Name(Option<Box<Transform<N>>>), String(Box<Transform<N>>), StartsWith(Box<Transform<N>>, Box<Transform<N>>), EndsWith(Box<Transform<N>>, Box<Transform<N>>), Contains(Box<Transform<N>>, Box<Transform<N>>), Substring(Box<Transform<N>>, Box<Transform<N>>, Option<Box<Transform<N>>>), SubstringBefore(Box<Transform<N>>, Box<Transform<N>>), SubstringAfter(Box<Transform<N>>, Box<Transform<N>>), NormalizeSpace(Option<Box<Transform<N>>>), Translate(Box<Transform<N>>, Box<Transform<N>>, Box<Transform<N>>), Boolean(Box<Transform<N>>), Not(Box<Transform<N>>), True, False, Number(Box<Transform<N>>), Sum(Box<Transform<N>>), Floor(Box<Transform<N>>), Ceiling(Box<Transform<N>>), Round(Box<Transform<N>>, Option<Box<Transform<N>>>), CurrentDateTime, CurrentDate, CurrentTime, FormatDateTime(Box<Transform<N>>, Box<Transform<N>>, Option<Box<Transform<N>>>, Option<Box<Transform<N>>>, Option<Box<Transform<N>>>), FormatDate(Box<Transform<N>>, Box<Transform<N>>, Option<Box<Transform<N>>>, Option<Box<Transform<N>>>, Option<Box<Transform<N>>>), FormatTime(Box<Transform<N>>, Box<Transform<N>>, Option<Box<Transform<N>>>, Option<Box<Transform<N>>>, Option<Box<Transform<N>>>), CurrentGroup, CurrentGroupingKey, UserDefined(QualifiedName, Vec<(String, Transform<N>)>, Box<Transform<N>>), Message(Box<Transform<N>>, Option<Box<Transform<N>>>, Box<Transform<N>>, Box<Transform<N>>), NotImplemented(String), Error(ErrorKind, String),
}
Expand description

Specifies how a Sequence is constructed.

Variants§

§

Root

Produces the root node of the tree containing the context item.

§

ContextItem

Produces a copy of the context item.

§

Compose(Vec<Transform<N>>)

A path in a tree. Each element of the outer vector is a step in the path. The result of each step becomes the new context for the next step.

§

Step(NodeMatch)

A step in a path.

§

Filter(Box<Transform<N>>)

Filters the selected items. Each item in the context is evaluated against the predicate. If the resulting sequence has an effective boolean value of ‘true’ then it is kept, otherwise it is discarded.

§

Empty

An empty sequence

§

Literal(Rc<Item<N>>)

A literal, atomic value.

§

LiteralElement(QualifiedName, Box<Transform<N>>)

A literal element. Consists of the element name and content.

§

Element(Box<Transform<N>>, Box<Transform<N>>)

A constructed element. Consists of the name and content.

§

LiteralAttribute(QualifiedName, Box<Transform<N>>)

A literal attribute. Consists of the attribute name and value. NB. The value may be produced by an Attribute Value Template, so must be dynamic.

§

LiteralComment(Box<Transform<N>>)

A literal comment. Consists of the value.

§

LiteralProcessingInstruction(Box<Transform<N>>, Box<Transform<N>>)

A literal processing instruction. Consists of the name and value.

§

SequenceItems(Vec<Transform<N>>)

Produce a Sequence. Each element in the vector becomes one, or more, item in the sequence.

§

Copy(Box<Transform<N>>, Box<Transform<N>>)

A shallow copy of an item. Consists of the selector of the item to be copied, and the content of the target.

§

DeepCopy(Box<Transform<N>>)

A deep copy of an item. That is, it copies an item including its descendants.

§

Or(Vec<Transform<N>>)

Logical OR. Each element of the outer vector is an operand.

§

And(Vec<Transform<N>>)

Logical AND. Each element of the outer vector is an operand.

§

GeneralComparison(Operator, Box<Transform<N>>, Box<Transform<N>>)

XPath general comparison. Each item in the first sequence is compared against all items in the second sequence.

§

ValueComparison(Operator, Box<Transform<N>>, Box<Transform<N>>)

XPath value comparison. The first singleton sequence is compared against the second singleton sequence.

§

Concat(Vec<Transform<N>>)

Concatenate string values

§

Range(Box<Transform<N>>, Box<Transform<N>>)

Produce a range of integer values. Consists of the start value and end value.

§

Arithmetic(Vec<ArithmeticOperand<N>>)

Perform arithmetic operations

§

Loop(Vec<(String, Transform<N>)>, Box<Transform<N>>)

A repeating transformation. Consists of variable declarations and the loop body.

§

Switch(Vec<(Transform<N>, Transform<N>)>, Box<Transform<N>>)

A branching transformation. Consists of (test, body) clauses and an otherwise clause.

§

ForEach(Option<Grouping<N>>, Box<Transform<N>>, Box<Transform<N>>)

Evaluate a transformation for each selected item, with possible grouping.

§

ApplyTemplates(Box<Transform<N>>)

Find a template that matches an item and evaluate its body with the item as the context. Consists of the selector for items to be matched.

§

ApplyImports

Find templates at the next import level and evaluate its body.

§

NextMatch

§

Union(Vec<Transform<N>>)

Set union

§

Call(Box<Transform<N>>, Vec<Transform<N>>)

Evaluate a named template or function, with arguments. Consists of the body of the template/function and the actual arguments (variable declarations).

§

VariableDeclaration(String, Box<Transform<N>>, Box<Transform<N>>)

Declare a variable in the current context. Consists of the variable name, its value, and a transformation to perform with the variable in scope.

§

VariableReference(String)

Reference a variable. The result is the value stored for that variable in the current context and current scope.

§

SetAttribute(QualifiedName, Box<Transform<N>>)

Set the value of an attribute. The context item must be an element-type node. Consists of the name of the attribute and its value. The Sequence produced will be cast to a Value.

§

Position

XPath functions

§

Last

§

Count(Box<Transform<N>>)

§

LocalName(Option<Box<Transform<N>>>)

§

Name(Option<Box<Transform<N>>>)

§

String(Box<Transform<N>>)

§

StartsWith(Box<Transform<N>>, Box<Transform<N>>)

§

EndsWith(Box<Transform<N>>, Box<Transform<N>>)

§

Contains(Box<Transform<N>>, Box<Transform<N>>)

§

Substring(Box<Transform<N>>, Box<Transform<N>>, Option<Box<Transform<N>>>)

§

SubstringBefore(Box<Transform<N>>, Box<Transform<N>>)

§

SubstringAfter(Box<Transform<N>>, Box<Transform<N>>)

§

NormalizeSpace(Option<Box<Transform<N>>>)

§

Translate(Box<Transform<N>>, Box<Transform<N>>, Box<Transform<N>>)

§

Boolean(Box<Transform<N>>)

§

Not(Box<Transform<N>>)

§

True

§

False

§

Number(Box<Transform<N>>)

§

Sum(Box<Transform<N>>)

§

Floor(Box<Transform<N>>)

§

Ceiling(Box<Transform<N>>)

§

Round(Box<Transform<N>>, Option<Box<Transform<N>>>)

§

CurrentDateTime

§

CurrentDate

§

CurrentTime

§

FormatDateTime(Box<Transform<N>>, Box<Transform<N>>, Option<Box<Transform<N>>>, Option<Box<Transform<N>>>, Option<Box<Transform<N>>>)

§

FormatDate(Box<Transform<N>>, Box<Transform<N>>, Option<Box<Transform<N>>>, Option<Box<Transform<N>>>, Option<Box<Transform<N>>>)

§

FormatTime(Box<Transform<N>>, Box<Transform<N>>, Option<Box<Transform<N>>>, Option<Box<Transform<N>>>, Option<Box<Transform<N>>>)

§

CurrentGroup

§

CurrentGroupingKey

§

UserDefined(QualifiedName, Vec<(String, Transform<N>)>, Box<Transform<N>>)

A user-defined callable. Consists of a name, an argument list, and a body. TODO: merge with Call?

§

Message(Box<Transform<N>>, Option<Box<Transform<N>>>, Box<Transform<N>>, Box<Transform<N>>)

Emit a message. Consists of a select expression, a terminate attribute, an error-code, and a body.

§

NotImplemented(String)

For things that are not yet implemented, such as: Union, IntersectExcept, InstanceOf, Treat, Castable, Cast, Arrow, Unary, SimpleMap, Is, Before, After.

§

Error(ErrorKind, String)

Error condition.

Trait Implementations§

source§

impl<N: Clone + Node> Clone for Transform<N>

source§

fn clone(&self) -> Transform<N>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<N: Debug + Node> Debug for Transform<N>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<N: Node> Display for Transform<N>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<N> RefUnwindSafe for Transform<N>
where N: RefUnwindSafe,

§

impl<N> !Send for Transform<N>

§

impl<N> !Sync for Transform<N>

§

impl<N> Unpin for Transform<N>

§

impl<N> UnwindSafe for Transform<N>
where N: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.