Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Making XSLT Transform faster Making XSLT Transform fasterTo: NULL Date: 4/6/2009 11:02:00 AM Hi,
I am trying to make my xslt transformation faster.
Sample of my My XML is as follows.
<?xml version="1.0" encoding="utf-16"?>
<AssessmentData xmlns:i="http://www.w3.org/2001/XMLSchema-instance" >
<PSHistory>
<ContactedTime i:nil="true" />
<DocumentationIncomplete>false</DocumentationIncomplete>
<FamSocHistNotes i:nil="true" />
<FirstAssessment>true</FirstAssessment>
<HelpAtHome>2</HelpAtHome>
<HelpAtHomeNo>true</HelpAtHomeNo>
<HelpAtHomeYes>false</HelpAtHomeYes>
<IsDirty>false</IsDirty>
</PSHistory>
</AssessmentData>
My XSLT contains the following sample structure.
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
exclude-result-prefixes="msxsl"
xmlns:ms="urn:schemas-microsoft-com:xslt"
xmlns:dt="urn:schemas-microsoft-com:datatypes">
<xsl:output method="text" indent="yes"/>
<xsl:template match="/">
<xsl:for-each select="AssessmentData/PSHistory">
<xsl:variable name ="SHVar" >
<xsl:if test ="HelpAtHome = '1'">
<xsl:text>has help at home, </xsl:text>
</xsl:if>
<xsl:if test ="HelpAtHome = '2'">
<xsl:text>does not have help at home, </xsl:text>
</xsl:if>
</xsl:variable>
<xsl:if test ="string-length($SHVar) >0">
<xsl:value-of select
="substring($SHVar,1,string-length($SHVar)-2)"/>
<xsl:text>. </xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Eventhough the PSHistory occurs only once in Assessments, i have used a
xsl:for-each stmt. Could this be slowing down my Transformation? Is there
anything i could do to speed up the Transformation?
I am new to XSLT.
Thanks in Advance for your help.
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
