XML

APPLYXSLT – Apply XSLT transformation

260 views June 1, 2018 admin 0

Overview

This Custom Field applies an XSLT transformation to the contents of a field, which should contain an XML fragment. Files are referenced from the data sources XSLT folder.

Requires the EasyCatalog XML data provider.

Syntax

APPLYXSLT(Namelist,’format.xsl‘)

Element Description
FieldName The field name to which the XLST template will be applied
XLST FileName The name of the XLST template to apply to an XML fragment in the specified field

Example

APPLYXSLT(Namelist,‘format.xsl’)

Contents of format.xsl:

<xsl:stylesheet version=”1.0″ xmlns:xsl=”http://www.w3.org/1999/XSL/Transform”>

   <xsl:template match=”/”>

       <html>

           <body>

                <table>

                   <xsl:for-each select=”//Option1[position() = 1]”>

                          <tr>

                               <th><xsl:value-of select=”@col1″/></th>

                               <th><xsl:value-of select=”@col2″/></th>

                         </tr>

                   </xsl:for-each>

                   <xsl:for-each select=”//Option1[position() &gt; 1]”>

                        <tr>

                           <td><xsl:value-of select=”@col1″/></td>

                           <td><xsl:value-of select=”@col2″/></td>

                        </tr>

                  </xsl:for-each>

                 </table>

              </body>

          </html>

     </xsl:template>

</xsl:stylesheet>

See also

EVALUATEXPATH

 

Was this helpful?