Bookmark and Share Share

Transforming Intermediate Results

There are several mashup statements that you can use in mashup scripts to select specific results, sort results, or otherwise transform the data in variables:

  • <assign> to assign values or copy part of all of a variable

  • <filter> to filter a variable

  • <group> to group data in a variable and optionally filter or sort

  • <sort> to sort a variable

  • <annotate> to add nodes and data to a variable

  • <script> to transform data using user-defined scripting code

  • <xslt> to transform data using XSLT stylesheets

Using XPath Functions to Transform Data

Many mashup transformations use XPath expressions to select specific nodes for a statement. These expressions can also be used to apply XPath 2.0 functions as part of the transformation.

Functions can transform data, change datatypes, perform calculations or determine boolean conditions. XPath includes many common functions for working with strings, numbers and dates. You can also use XPath constructor functions to cast data to other datatypes.

For some basic examples of XPath functions that transform data, see A Brief Introduction to XPath 2.0. For detailed information about any of these functions or other functions you can use, see the XPath 2.0 Functions specification or the XPath 2.0 Data Model Types. You can also create custom XPath functions to transform data to meet your specific requirements. See Defining Custom XPath Functions for more information.