Here is the small example with steps to use xslt while indexing xml file into Endeca.
1. First of all configure xml file in Record Adapter of pipeline.
2. Then click on Transformer tab.
Here configure below two fields.
a. Type : The file format of the transformation style sheet.The
only valid value is
XSLT.
b. URL : Specifies the location of the .xsl file. The path is either an absolute
path or a path relative to the location of the Pipeline.epx file. In this example transform.xsl file is located at the location of the pipeline.epx file.
In this example xslt is used to convert name to uppercase.
------------------------------------------------------------------------------------------------------------------------
transform.xsl
------------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
<xsl:template match="/">
<RECORDS>
<xsl:for-each select="employees/employee">
<RECORD>
<PROP NAME="P_Age">
<PVAL><xsl:value-of select="age"/></PVAL>
</PROP>
<PROP NAME="P_Name">
<PVAL><xsl:value-of select="translate(name, $smallcase, $uppercase)"/></PVAL>
</PROP>
<PROP NAME="Dep_ID">
<PVAL><xsl:value-of select="depid"/></PVAL>
</PROP>
</RECORD>
</xsl:for-each>
</RECORDS>
</xsl:template>
</xsl:stylesheet>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
<xsl:template match="/">
<RECORDS>
<xsl:for-each select="employees/employee">
<RECORD>
<PROP NAME="P_Age">
<PVAL><xsl:value-of select="age"/></PVAL>
</PROP>
<PROP NAME="P_Name">
<PVAL><xsl:value-of select="translate(name, $smallcase, $uppercase)"/></PVAL>
</PROP>
<PROP NAME="Dep_ID">
<PVAL><xsl:value-of select="depid"/></PVAL>
</PROP>
</RECORD>
</xsl:for-each>
</RECORDS>
</xsl:template>
</xsl:stylesheet>
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
Sample input xml file (data.xml)
------------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<employees>
<employee>
<name>Jon</name>
<age>20</age>
<depid>123</depid>
</employee>
<employee>
<name>Ban</name>
<age>30</age>
<depid>456</depid>
</employee>
<employee>
<name>Kim</name>
<age>40</age>
<depid>789</depid>
</employee>
</employees>
<employees>
<employee>
<name>Jon</name>
<age>20</age>
<depid>123</depid>
</employee>
<employee>
<name>Ban</name>
<age>30</age>
<depid>456</depid>
</employee>
<employee>
<name>Kim</name>
<age>40</age>
<depid>789</depid>
</employee>
</employees>
------------------------------------------------------------------------------------------------------------------------
3. Run baseline indexing and see the resutls in jspref.