Mashables and Mashups : Mashups in EMML : Expressions for Mashups : Dynamic Mashup Expressions : Dynamic Expressions in XPath Expressions
Dynamic Expressions in XPath Expressions
XPath expressions used in a mashup script or macro can contain dynamic mashup expressions. This allows the behavior of the mashup script or macro to be dynamic based on input parameters.
In the example shown below, the path that defines the nodes to use in a <filter> statement is defined in a variable named selectedItem. The variable must be resolved first, to get the full XPath expression to use for filtering.
<filter outputvariable="$result"
filterexpr="{$selectedItem}[matches(title, $feedfilter)]"/>
This next example also shows a filter where only a portion of the XPath that selects nodes is from a dynamic mashup expression:
<filter outputvariable="$result"
filterexpr="$documents/product/{$version}/]"/>
Dynamic expressions can also be passed from a <template> declaration. For example:
<template expr="{$selectedItem}[matches(title, $feedfilter)]"
outputvariable="inputFilter"/>
<filter outputvariable="$result" filterexpr="$inputFilter"/>
Copyright © 2013-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback