pipeline:for-each

Purpose

Iterates over a sequence of values, setting a named variable to each value in turn. and processing the operation's body content as pipeline markup.

Please note that variables defined within pipeline:for-each are not visible outside the element.

Attributes

Attribute Description Type Default Options Use
in An expression that results in a sequence over which the operation iterates xs:string none    required 
variable Identifies the variable that will be created and populated with each item from the sequence in turn xs:QName none    required 

Example

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/2002/06/xhtml2"
  xmlns:pipeline="http://www.volantis.com/xmlns/marlin-pipeline">
  <head>
    <title>pipeline:for-each</title>
  </head>
  <body>
    <div>
      <ul>
        <pipeline:for-each variable="choices" in="(1,2,3)">
          <li>
            <pipeline:value-of expr="$choices"/>
          </li>
        </pipeline:for-each>
      </ul>
    </div>
  </body>
</html>

Related topics