[xsl] csv slows down transform

Subject: [xsl] csv slows down transform
From: Jonathan Kart <jkart@xxxxxxxxxxxx>
Date: Tue, 5 Oct 2004 16:47:29 -0700
Hi all,

I have 2 sample stylesheets to show you. They are auto-generated, so please forgive the redundancy and other flaws. My question is, what does the first stylesheet consistently run slower than the second. For an xml doc of about 2500 'Contacts' this first sheet takes ~14 seconds, the second less than 1 second. I swear the only difference is that one inserts quotes and commas around the data while the other does not. It's not a trick question i promise. The time difference is substantial. We're using the php libxml extension in a web environment under windows 200 server, and iis.

Thanks for any help, this is boggling my itty-bitty mind.

SHEET 1
-----------
<xsl:stylesheet version="1.0" exclude-result-prefixes="dt" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; xmlns:dt="http://xsltsl.org/date-time";>
<xsl:import href="http://www.newdream.org/CMS/lib/xslsl/stdlib.xsl"; />
<xsl:output method="xml" />
<xsl:template match="text()">
<xsl:value-of select="." disable-output-escaping="yes" />
</xsl:template>
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates select="@*" />
<xsl:apply-templates select="node()" />
</xsl:copy>
</xsl:template>
<xsl:template match="@*">
<xsl:copy />
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="//region[@id=\'region93\']">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="assignment[@id=\'assignment\']">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="Contacts">
<xsl:apply-templates select="Full_Name" />
<xsl:apply-templates select="Activity_Points" />
<xsl:text>
&#10;
</xsl:text>
</xsl:template>
<xsl:template match="Full_Name">
&quot;
<xsl:apply-templates />
&quot;,
</xsl:template>
<xsl:template match="Full_Name" mode="Normal">
&quot;
<xsl:apply-templates />
&quot;,
</xsl:template>
<xsl:template match="Activity_Points">
&quot;
<xsl:apply-templates />
&quot;,
</xsl:template>
<xsl:template match="Activity_Points" mode="Normal">
&quot;
<xsl:apply-templates />
&quot;,
</xsl:template>
</xsl:stylesheet>


SHEET 2 - same thing, but no &quot; no , and no &#10;
------------

<xsl:stylesheet version="1.0" exclude-result-prefixes="dt" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; xmlns:dt="http://xsltsl.org/date-time";>
<xsl:import href="http://www.newdream.org/CMS/lib/xslsl/stdlib.xsl"; />
<xsl:output method="xml" />
<xsl:template match="text()">
<xsl:value-of select="." disable-output-escaping="yes" />
</xsl:template>
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates select="@*" />
<xsl:apply-templates select="node()" />
</xsl:copy>
</xsl:template>
<xsl:template match="@*">
<xsl:copy />
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="//region[@id=\'region93\']">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="assignment[@id=\'assignment\']">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="Contacts">
<xsl:apply-templates select="Full_Name" />
<xsl:apply-templates select="Activity_Points" />
</xsl:template>
<xsl:template match="Full_Name">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="Full_Name" mode="Normal">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="Activity_Points">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="Activity_Points" mode="Normal">
<xsl:apply-templates />
</xsl:template>
</xsl:stylesheet>


Current Thread