Skip to content

XSL Plug-in

This is a plug-in that transform a xml stream by using XSL code from the rpl file. The output is a stream. In order to use it a number properties has to be set in the rpl file.

Report Plug-in Layout

Layout properties

The required layout properties for the xsl plug-in:

Name Value
plugin-type XSL
plugin-class ifs.application.reportingservices.impl.extendedformatter.xslplugin.XSLPlugin
output-extension xml

Plug-in properties

This plug-in does not use any properties.

Plug-in data

The XSL code is written inside the <data> tag of the rpl. The expected format is:

<data>  
    <![CDATA[Write your xsl code here!]]>  
</data>

Plug-in variables

This plug-in does not use the variable tag of the report plug-in layout.

Example

An example of a rpl file with xsl code that transforms a xml file into a csv file.

<?xml version="1.0" encoding="UTF-8"?>  
<report-layout>  
    <properties>  
        <version>0.1</version>  
        <layout-type>XSL</layout-type> <!--SCRIPT,XSL,XML,EXCEL-->  
        <plugin-class>ifs.application.reportingservices.impl.extendedformatter.xslplugin.XSLPlugin</plugin-class>  
        <output-method>FILE</output-method> <!-- BINARY,FILE,E-MAIL-->  
        <output-extension>xml</output-extension>  
        <default-output-reference>  
           <binary>\\user\ZebraGX4</binary>  
           <file>FileName.xml</file>  
           <file-sender>FILE_SENDER1</file-sender>  
   <e-mail>firstname.lastname@something.com</e-mail>  
   <e-mail-sender>firstname.lastname@something.com</e-mail-sender>  
   <e-mail-cc></e-mail-cc>  
   <e-mail-subject>Email Subject</e-mail-subject>  
   <e-mail-body>  
<![CDATA[  
Email Body Content from the RPL  
]]>   
   </e-mail-body>  
        </default-output-reference>  
        <full-xml>TRUE</full-xml>  
<flattened-xml>  
<enabled>TRUE</enabled>  
<strongtyping>TRUE</strongtyping>  
    </flattened-xml>  
        <report-id>MODULE_REP</report-id>  
        <report-title>RPL LAYOUT</report-title>  
    </properties>  
    <plugin>  
        <properties>  
            <!-- not used by this plugin -->  
        </properties>  
        <data>   
            <![CDATA[  
                <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">  
                    <xsl:output method="text" encoding="UTF-8"/>  
                    <xsl:param name="delim" select="string(';')" />  
                    <xsl:param name="quote" select="string('&quot;')" />  
                    <xsl:param name="break" select="string('&#xD;')" />  
                    <xsl:template match="/">  
                        <xsl:apply-templates select="*/Row" />  
                    </xsl:template>  
                    <xsl:template match="Row">  
                        <xsl:apply-templates />  
                        <xsl:if test="following-sibling::*">  
                            <xsl:value-of select="$break" />  
                        </xsl:if>  
                    </xsl:template>  
                    <xsl:template match="*">  
                        <xsl:value-of select="concat($quote, normalize-space(.), $quote)" />  
                        <xsl:if test="following-sibling::*">  
                            <xsl:value-of select="$delim" />  
                        </xsl:if>  
                    </xsl:template>  
                    <xsl:template match="text()" />  
                </xsl:stylesheet>  
            ]]>  
        </data>  
        <variables>  
            <!-- not used by this plugin -->  
        </variables>  
    </plugin>  
</report-layout>