Late SXML Execution

Release 1.0 - ...

The iXperion publication engine supports SXML string execution using the sxml.execute() Viper method. Using this method, you can inject previously assembled SXML data into the parser.

The following example illustrates the assembly of formatting elements which are then executed as a format macro:

Smartsite SXML CopyCode image Copy Code
<se:hidden>
 <se:text save="sitemap_rowformat">
  <![CDATA[
   <se:rowformat>
    <li id="tc_leaf_{this.field(nr)}">
     {this.field(title)}
     {this.childlevelresult()}
    </li>
   </se:rowformat>
  ]]>
 </se:text>
 
 <se:text save="sitemap_levelformat">
  <![CDATA[
   <se:levelformat groupby="this.field(level)">
    <ul class="expandable">
     {this.levelresult()}
    </ul>
   </se:levelformat>
  ]]>
 </se:text>
 
 <se:sitemap startitem="testcontent" save="tc" resulttype="datatable"/>
 
 <se:text save="format">
  <![CDATA[<se:format inputdata="tc">]]>
    {buffer.get('sitemap_rowformat')}
    {buffer.get('sitemap_levelformat')}
  <![CDATA[</se:format>]]>
 </se:text>
</se:hidden>
{sxml.execute(sxml.decode(buffer.get('format')))}