pipeline:value-of

Purpose

Permits the value of an expression to be inserted into the content. It can handle the results of any expressions, including the values of complex template variables.

Attribute

Attribute Description Type Default Options Use
expr The expression to insert xs:string     required 

Examples

The pipeline:value-of element can be used along with MCS function expressions. Refer to the topic entitled MCS function expressions for more information about the functions.

<?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:value-of</title>
  </head>
  <body>
    <p>Device name: <pipeline:value-of expr="device:getDeviceName()"/></p>
    <p>Usable width: <pipeline:value-of expr="device:policy-value('pixelsx')"/></p>
  </body>
</html>

The pipeline:value-of element can also be used within templates.

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/2002/06/xhtml2"
  xmlns:template="http://www.volantis.com/xmlns/marlin-template">
  <head>
    <title>pipeline:value-of</title>
  </head>
  <body>
    <template:apply href="test.xdtpl">
      <template:binding name="simple">
        <template:simpleValue>Welcome to Jive Intranet</template:simpleValue>
      </template:binding>
      <template:binding name="complex">
        <template:complexValue>
          <div>
            <p>Jive Sports is seeking people to fill new job openings.</p>
          </div>
        </template:complexValue>
      </template:binding>
    </template:apply>
  </body>
</html>

The test.xdtpl template should contain the following code.

<?xml version="1.0" encoding="UTF-8"?>
<template:definition xmlns="http://www.w3.org/2002/06/xhtml2"
  xmlns:template="http://www.volantis.com/xmlns/marlin-template"
  xmlns:pipeline="http://www.volantis.com/xmlns/marlin-pipeline">
  <template:documentation> </template:documentation>
  <template:declarations>
    <template:parameter name="simple" type="simple" expressionVariable="simple"/>
    <template:parameter name="complex" type="complex" expressionVariable="complex"/>
  </template:declarations>
  <template:body>
    <div>
      <pipeline:value-of expr="$simple"/>
    </div>
    <div>
      <pipeline:value-of expr="$complex"/>
    </div>
  </template:body>
</template:definition>

Related topics