Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: XSL really slow please help >Thread Next - Re: XSL really slow please help Re: XSL really slow please helpTo: NULL Date: 3/12/2009 11:51:00 AM I appreciate the advise, but it's a .NET 1.1 app I'm maintaining. I can't re-write it in the time constraints I have, I just need to add in a new export type. What strikes me as strange is that we have other style sheets that produce tab delimited text, or csv, with the same amount of data but don't have the performance issues of this xsl. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text" indent="no"/> <xsl:variable name="delimiter" select="' '"/> <xsl:variable name="delimiterReplacement" select="' '"/> <xsl:variable name="poundsign" select="'_x0023_'"/> <xsl:variable name="EOL" select="' '"/> <xsl:template match="/"> <xsl:for-each select="/*/*[position()=1]"> <xsl:for-each select="*"> <xsl:choose> <xsl:when test="contains(name(.), $poundsign)"> <xsl:value-of select="concat(substring-before(translate(name(.), $poundsign, '#'), '##'), '#', substring-after(translate(name(.), $poundsign, '#'), '##'))"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="name(.)"/> </xsl:otherwise> </xsl:choose> <xsl:if test="not(position() = last())"> <xsl:value-of select="$delimiter"/> </xsl:if> </xsl:for-each> </xsl:for-each> <xsl:value-of select="$EOL"/> <xsl:for-each select="/*/*"> <xsl:for-each select="*"> <xsl:value-of select="translate(translate(., $EOL, ' '), $delimiter, $delimiterReplacement)"/> <xsl:if test="not(position() = last())"> <xsl:value-of select="$delimiter"/> </xsl:if> </xsl:for-each> <xsl:value-of select="$EOL"/> </xsl:for-each> </xsl:template> </xsl:stylesheet> I'm just trying to figure out how to do something similiar but with a different target format. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
