XML operators reference

This article provides information about a collection of activities that are immediately available for manipulation of XML.

The symbols in activity description can be found in the flow language behavior and syntax information.

The following sections of this article provide information about these activities that are built into Assemble flow:

XPath

The XPath activity selects a node list of the input XML DOM node by a valid XPath 1.0 expression. The expression is specified by the value of attribute select as shown in the following example.

<XPath name="NCName" select="XPath1.0-expr" outputVariable="NCName"?>
         input
        control*
</XPath>
Attributes
Name Description Required
select XPATH 1.0 expression for selection. Yes
outputVariable Output variable. No
  • The input value should be the DOM node or the XML document in String.
  • The result of the XPath activity is a list of DOM nodes.
  • The namespace prefix used in the XPath expression should be predefined or declared in the <process> element of the flow.

The following example selects the Yahoo!® top story Feed title of the first entry in a feed.

<process name="xpath">
    <feed url="http://rss.news.yahoo.com/rss/topstories" name="feed_0"/>
    <XPath select="//atom:entry[1]/atom:title/text()" name="XPath_0">
        <input value="${feed_0}"/>
    </XPath>
    <replyGET name="End">
        <input value="${XPath_0}"/>
    </replyGET>
</process>

The sample is shown in the toolkit as in the following example:

xpath.JPG

The extension of XPath function is supported.

XSLT

The XSLT activity performs the XSLT transform. The stylesheet URL is specified by the url attribute, as shown in the following example.

<XSLT name="NCName" url="relative-url" outputVariable="NCName"?>
        <input value="Expression"/>
        <input name="variables" value="Map"/>
        <control/>*
</XSLT>
Attributes
Name Description Required
url The relative url of the .xsl stylesheet. Yes
outputVariable Output variable No
  • The input without a name is the source for transformation. Its value should be the DOM node or the XML document in String.
  • The value of the optional variables input should be a map to designate the variables used in the .xsl file.
  • The result of XSLT activity is the DOM node for the root element of the target document.

The following sample transforms MexicoStoreFeed to a new one by running the script in the currency.xsl file.

<process name="xslt">
    <feed url="/reportsdemo/mexico/mexico.xml" name="feed_0"/>
    <XSLT url="./currency.xsl" name="XSLT_0">
        <input value="${feed_0}"/>
        <input name="variables" value="${[exchangeRate:0.088]}"/>
    </XSLT>
    <replyGET name="End">
        <input value="${XSLT_0}"/>
    </replyGET>
</process>

The sample is shown in the tooling like in the following example:

xslt.JPG

Version 1.0.0.3.25591