Integrate Software AG Products Using Digital Event Services 10.4 | Integrate Software AG Products Using Digital Event Services | MashZone NextGen Help | Appendix | Legacy Presto components | 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 © 2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release