I've got the same problem:
Here's the XML file:
------------------------------------------------
<query>
<selectSet>
<select visible="N">
<columnName>arpr_field_oid</columnName>
<columnAlias>result_key</columnAlias>
<indexName>ARPR_FIELD281390</indexName>
<resourceOid>0</resourceOid>
</select>
<select visible="Y">
<columnName>arpr_field_name</columnName>
<columnAlias>field_name</columnAlias>
<indexName>ARPR_FIELD281390</indexName>
<resourceOid>2000910</resourceOid>
</select>
<select visible="Y">
<columnName>d_arpr_main_field_name</columnName>
<columnAlias>main_field_name</columnAlias>
<indexName>ARPR_FIELD281390</indexName>
<resourceOid>2001005</resourceOid>
</select>
<select visible="Y" translate="Y">
<columnName>arpr_field_type_cd</columnName>
<columnAlias>arpr_field_type_cd</columnAlias>
<indexName>ARPR_FIELD281390</indexName>
<resourceOid>2001032</resourceOid>
</select>
</selectSet>
<sortSet>
<sort>
<columnName>main_field_name</columnName>
</sort>
<sort>
<columnName>arpr_field_type_cd</columnName>
</sort>
<sort>
<columnName>field_name</columnName>
</sort>
<sort>
<columnName>result_key</columnName>
</sort>
</sortSet>
<fromSet>
<from>
<tableName>arpr_field</tableName>
<indexName>ARPR_FIELD281390</indexName>
<alias>a</alias>
</from>
</fromSet>
<whereSet>
<where>
<indexFrom>ARPR_FIELD281390</indexFrom>
<columnFrom>deleted_flag</columnFrom>
<operator>=</operator>
<value>N</value>
<dataType>Character</dataType>
</where>
<where upper="Y" wildcard="Y">
<indexFrom>ARPR_FIELD281390</indexFrom>
<columnFrom>arpr_field_name</columnFrom>
<operator>=</operator>
<value>gg</value>
<dataType>Varchar2</dataType>
</where>
</whereSet>
</query>
------------------------------------------------
Here's the XSLT file:
------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v2004 rel. 2 U (
http://www.xmlspy.com) by hairul
(iPerintis Sdn Bhd) -->
<xsl:stylesheet version="1.0"
xmlns:xsl="
http://www.w3.org/1999/XSL/Transform" xmlns:search="IPSearch">
<xsl:output method="text" version="1.0" encoding="UTF-8" indent="no"
omit-xml-declaration="yes"/>
<xsl:key name="from_indexname" match="/query/fromSet/from"
use="./indexName"/>
<xsl:param name="inWildcard">*</xsl:param>
<xsl:param name="outWildcard">%</xsl:param>
<xsl:param name="hint"/>
<xsl:template match="/">
<xsl:apply-templates select="./query"/>
</xsl:template>
<xsl:template match="query">
<xsl:apply-templates select="./selectSet"/>
<xsl:apply-templates select="./whereSet" mode="from"/>
<xsl:apply-templates select="./whereSet"/>
</xsl:template>
<xsl:template match="selectSet">
<xsl:value-of select="'SELECT '"/>
<xsl:value-of select="concat($hint,' ')"/>
<xsl:apply-templates select="./select"/>
</xsl:template>
<xsl:template match="select">
<xsl:variable name="alias">
<xsl:choose>
<xsl:when test="./columnAlias != ''">
<xsl:value-of select="concat(' AS ',./columnAlias)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="''"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="./functionName">
<xsl:value-of select="concat(./functionName, ' (')"/>
<xsl:apply-templates select="./functionParamSet"/>
<xsl:value-of select="concat(')', $alias)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(key('from_indexname',
./indexName)/alias, '.', ./columnName, $alias)"/>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="position() != last()">
<xsl:value-of select="','"/>
</xsl:if>
<xsl:value-of select="' '"/>
</xsl:template>
<xsl:template match="functionParamSet">
<xsl:apply-templates select="./functionParam"/>
</xsl:template>
<xsl:template match="functionParam">
<xsl:variable name="quote">
<xsl:choose>
<xsl:when test="./dataType != 'Integer'">
<xsl:value-of select='"'"'/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="''"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="./indexName">
<xsl:value-of select="concat(key('from_indexname',
./indexName)/alias, '.', ./columnName)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($quote, ./value, $quote)"/>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="position() != last()">
<xsl:value-of select="', '"/>
</xsl:if>
</xsl:template>
<xsl:template match="whereSet" mode="from">
<xsl:choose>
<xsl:when test="count(./where) > 0">
<xsl:choose>
<xsl:when test="count(./where[./indexTo]) > 0">
<xsl:value-of select="'FROM '"/>
<xsl:apply-templates select="./where[./indexTo]" mode="from1"/>
<xsl:apply-templates select="./where[./indexTo]" mode="from2"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('FROM ',key('from_indexname',
./where/indexFrom)/tableName, ' ' ,key('from_indexname',
./where/indexFrom)/alias,' ')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="where" mode="from1">
<xsl:value-of select="'('"/>
</xsl:template>
<xsl:template match="where" mode="from2">
<xsl:variable name="tmp_value1">
<xsl:if test="position() = 1">
<xsl:value-of select="concat(key('from_indexname',
./indexFrom)/tableName, ' ' ,key('from_indexname', ./indexFrom)/alias,'
')"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="tmp_value2">
<xsl:call-template name="wherex">
<xsl:with-param name="indexFrom">
<xsl:value-of select="./indexFrom"/>
</xsl:with-param>
<xsl:with-param name="columnFrom">
<xsl:value-of select="./columnFrom"/>
</xsl:with-param>
<xsl:with-param name="outerjoin">
<xsl:value-of select="./@outerjoin"/>
</xsl:with-param>
<xsl:with-param name="indexTo">
<xsl:value-of select="./indexTo"/>
</xsl:with-param>
<xsl:with-param name="columnTo">
<xsl:value-of select="./columnTo"/>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat($tmp_value1,' ',$tmp_value2,') ')"/>
</xsl:template>
<xsl:template name="wherex">
<xsl:param name="indexFrom"/>
<xsl:param name="indexTo"/>
<xsl:param name="columnFrom"/>
<xsl:param name="columnTo"/>
<xsl:param name="outerjoin"/>
<xsl:choose>
<xsl:when test="$outerjoin = 'Y'">
<xsl:value-of select="' LEFT JOIN '"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="' JOIN '"/>
</xsl:otherwise>
</xsl:choose>