| Subject: Re: [xsl] bad programming for speedup? From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Tue, 24 Jul 2007 12:25:19 +0200 | 
Cheers, Abel Braaksma
Hello everybody,
I'm new to this list, so let me introduce myself: My name is Christoph Naber. I come from Germany and work with XML/XSL for about 2 years now.
I'd be pleased to hear your opinion about a stylesheet I've written.
The aim is to surround occurences of <row> - tags with a <table> - tag.
I've done this with "good" XSL, what appears to be real slow
, and with a "bad" version, which inserts tags as <xsl:text>.
The second version:
<xsl:template match="row" >
<xsl:if test="name(preceding-sibling::*[1]) != 'row'">
<xsl:text disable-output-escaping="yes"><![CDATA[<table>]]></xsl:text>
</xsl:if>
<xsl:text>
</xsl:text>
<xsl:copy>
<xsl:copy-of select="@*" />
<xsl:apply-templates select="*" /> </xsl:copy>
<xsl:if test="name(following-sibling::*[1]) != 'row'">
<xsl:text disable-output-escaping="yes"><![CDATA[</table>]]></xsl:text>
</xsl:if>
   <xsl:template match="/">
       <xsl:apply-templates select="your/path/to/row[1]" />
   </xsl:template>   <xsl:template match="row">
       <table>
           <xsl:copy-of select=". | following-sibling::row" />
       </table>
   </xsl:template>| Current Thread | 
|---|
| 
 | 
| <- Previous | Index | Next -> | 
|---|---|---|
| Re: [xsl] bad programming for speed, Andrew Welch | Thread | Re: [xsl] bad programming for speed, Justin Johansson | 
| Re: [xsl] bad programming for speed, Andrew Welch | Date | RE: [xsl] bad programming for speed, Michael Kay | 
| Month |