Code:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="http://mycompany.com/mynamespace">
<msxsl:script language="JScript" implements-prefix="user">
var columnList="";
function setColumnList(colList)
{
columnList=","+colList+",";
return 0;
}
function CheckValidColumns(colName)
{
if(columnList.indexOf(","+colName+",")!=-1)
{
return 2;
}
else
{
return 0;
}
}
</msxsl:script>
<xsl:param name="columnList"></xsl:param>
<xsl:param name="startNodePosition"></xsl:param>
<xsl:param name="endNodePosition"></xsl:param>
<xsl:template match="/" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
<xsl:variable name="col">
<xsl:value-of select="user:setColumnList($columnList)"/>
</xsl:variable>
<xsl:for-each select="//em[@webReportKey]/em[position() >$startNodePosition and position() <=$endNodePosition]">
<Row>
<xsl:for-each select="@*">
<xsl:if test="user:CheckValidColumns(name())>0">
<Cell>
<xsl:attribute name="ss:StyleID">
<xsl:text>data</xsl:text>
</xsl:attribute>
<Data ss:Type="String">
<xsl:value-of select="."/>
</Data>
</Cell>
</xsl:if>
</xsl:for-each>
</Row>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
We are using the above code for report generation via web application.
But for bulk data(1.5lakh records), it is taking long time to load.
Can we get any better way to improve the performance?