Class name | com.ebd.hub.datawizard.iu.XSLTExternalMappingIU |
This Integration Unit can be used to execute an XSLT transformation on an XML file. See example below.
Parameters
Parameter | Allowed values | Default value | Description |
|---|---|---|---|
debug | true, false | false | If true, the temporary files (see log) are not deleted. |
xslt factory | net.sf.saxon.TransformerFactoryImpl | Specification of XSLT factory. Use the default value. Note: If you want to use a different factory, place the .jar files in folder ./extlib and restart the Integration Server (to load the classes). | |
xslt file | Path of XSLT file. Note: Several XSLT files can be specified, separated by semicolons, which are then processed sequentially. For example, ./conf/xslt_test/xslt_v1.xslt;./conf/xslt_test/xslt_v2.xslt |
Example
Create a new profile, choose Input Agent "Man. Upload", and then select document type "Custom Class" (this setting sends the data directly to the Integration Unit). You can use the settings above for the Integration Unit in phase 5. The specified XSLT file will be provided below. Create a Response of type "File" and use the file path ./tmp/xslt/ausgabe_xslt.xml . Set the content to Output of IU. Important note: The Integration Unit expects files with UTF-8 encoding.
The following is the XSLT file specified in the Integration Unit.
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="teacher">
<p><u><xsl:value-of select="."/></u></p>
</xsl:template>
<xsl:template match="student">
<p><b><xsl:value-of select="."/></b></p>
</xsl:template>
<xsl:template match="/">
<html>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>Use the following XML file as the input file for the profile.
<?xml-stylesheet type="text/xsl" href="class.xsl"?>
<class>
<student>Jack</student>
<student>Harry</student>
<student>Rebecca</student>
<teacher>Mr. Bean</teacher>
</class>Your profile should produce the following output file.
<html>
<body>
<p><b>Jack</b></p>
<p><b>Harry</b></p>
<p><b>Rebecca</b></p>
<p><u>Mr. Bean</u></p>
</body>
</html>