XSL Transformation of repeating section to html

Blog Post created by mlauer Champion on Nov 6, 2015

Repeating section as html table in mail describes how to transform a repeating section to html. It was done by template rules. Problem was it outputs all the Text Data that is present in the XML file even if no template rule is defined for a repeating section control since then applies the default rule for text.


To avoid that here for-each is used in stylesheet. Only these fields that have to appear in the output must be specified.


<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet xmlns:xsl="" version="1.0">

   <xsl:output method="html" />

   <!-- transform repeating section from xml to html -->

   <xsl:template match="/">

      <table border="1" width="100%" style="border-collapse:collapse;background-color:#eee;border:1px solid;color:black;font-size:100%;font-family:arial,helvetica,sans-serif;">



               <td>first name</td>






            <xsl:for-each select="//Items/Item">



                     <xsl:value-of select="first_name" disable-output-escaping="yes" />



                     <xsl:value-of select="last_name" disable-output-escaping="yes" />



                     <xsl:value-of select="company" disable-output-escaping="yes" />









Except for the stylesheet, everything remains as in Repeating section as html table in mail .