Transform

Enum Transform 

Source
pub enum Transform<N: Node> {
Show 81 variants Root, ContextItem, CurrentItem, Compose(Vec<Transform<N>>), Step(NodeMatch), Filter(Box<Transform<N>>), Empty, Literal(Item<N>), LiteralElement(Rc<QualifiedName>, Box<Transform<N>>), Element(Box<Transform<N>>, Box<Transform<N>>), LiteralText(Box<Transform<N>>, OutputSpec), LiteralAttribute(Rc<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>>, Vec<(Order, Transform<N>)>), ApplyTemplates(Box<Transform<N>>, Option<Rc<QualifiedName>>, Vec<(Order, Transform<N>)>), ApplyImports, NextMatch, Union(Vec<Transform<N>>), Call(Box<Transform<N>>, Vec<Transform<N>>, Rc<NamespaceMap>), VariableDeclaration(String, Box<Transform<N>>, Box<Transform<N>>, Rc<NamespaceMap>), VariableReference(String, Rc<NamespaceMap>), SetAttribute(Rc<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>>), GenerateId(Option<Box<Transform<N>>>), Boolean(Box<Transform<N>>), Not(Box<Transform<N>>), True, False, Number(Box<Transform<N>>), Sum(Box<Transform<N>>), Avg(Box<Transform<N>>), Min(Box<Transform<N>>), Max(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>>>), FormatNumber(Box<Transform<N>>, Box<Transform<N>>, Option<Box<Transform<N>>>), FormatInteger(Box<Transform<N>>, Box<Transform<N>>), GenerateIntegers(Box<Transform<N>>, Box<Transform<N>>, Box<Numbering<N>>), CurrentGroup, CurrentGroupingKey, Key(Box<Transform<N>>, Box<Transform<N>>, Option<Box<Transform<N>>>, Rc<NamespaceMap>), SystemProperty(Box<Transform<N>>, Rc<NamespaceMap>), AvailableSystemProperties, Document(Box<Transform<N>>, Option<Box<Transform<N>>>), Invoke(Rc<QualifiedName>, ActualParameters<N>, Rc<NamespaceMap>), 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.

§

CurrentItem

Produces a copy of the current item (see XSLT 20.4.1).

§

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(Item<N>)

A literal, atomic value.

§

LiteralElement(Rc<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.

§

LiteralText(Box<Transform<N>>, OutputSpec)

A literal text node. Consists of the value of the node. Second argument gives an output hint.

§

LiteralAttribute(Rc<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>>, Vec<(Order, Transform<N>)>)

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

§

ApplyTemplates(Box<Transform<N>>, Option<Rc<QualifiedName>>, Vec<(Order, 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, the mode, and sort keys.

§

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>>, Rc<NamespaceMap>)

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

§

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

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

§

VariableReference(String, Rc<NamespaceMap>)

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

§

SetAttribute(Rc<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>>)

§

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

§

Boolean(Box<Transform<N>>)

§

Not(Box<Transform<N>>)

§

True

§

False

§

Number(Box<Transform<N>>)

§

Sum(Box<Transform<N>>)

§

Avg(Box<Transform<N>>)

§

Min(Box<Transform<N>>)

§

Max(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>>>)

§

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

§

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

Convert a number to a string. This is one half of the functionality of xsl:number, as well as format-integer(). See XSLT 12.4. First argument is the integer to be formatted. Second argument is the format specification.

§

GenerateIntegers(Box<Transform<N>>, Box<Transform<N>>, Box<Numbering<N>>)

Generate a sequence of integers. This is one half of the functionality of xsl:number. First argument is the start-at specification. Second argument is the select expression. Third argument is the level. Fourth argument is the count pattern. Fifth argument is the from pattern.

§

CurrentGroup

§

CurrentGroupingKey

§

Key(Box<Transform<N>>, Box<Transform<N>>, Option<Box<Transform<N>>>, Rc<NamespaceMap>)

Look up a key. The first argument is the key name, the second argument is the key value, the third argument is the top of the tree for the resulting nodes, the fourth argument is the in-scope namespaces.

§

SystemProperty(Box<Transform<N>>, Rc<NamespaceMap>)

Get information about the processor

§

AvailableSystemProperties

§

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

Read an external document

§

Invoke(Rc<QualifiedName>, ActualParameters<N>, Rc<NamespaceMap>)

Invoke a callable component. Consists of a name, an actual argument list, and in-scope namespace declarations.

§

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 duplicate 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: Node> Debug 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> Freeze for Transform<N>
where N: Freeze,

§

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>
where N: Unpin,

§

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

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.
Source§

impl<T> ErasedDestructor for T
where T: 'static,