[xsl] Performance Issue (if any?)

Subject: [xsl] Performance Issue (if any?)
From: "Robin Samways" <rsamways@xxxxxxxxxxxx>
Date: Mon, 14 May 2001 03:45:27 -0400
Hi all,

Just wondering if there are any performance issues and/or preferred methods
of deciding when it is best to use <xsl:call-template name="whatever"> over
<xsl:template match="somenode" mode="withmode">.  In this case, I only need
to make 2 passes (so far!), so is there any difference really?

My xsl sheet looks as follows:

---------------------------------------

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">
  <xsl:output method="xml"
              version="1.0"
              indent="yes"
              doctype-system="http://www.wapforum.org/DTD/wml_1.1.xml";
              doctype-public="-//WAPFORUM//DTD WML 1.1//EN"/>
  <xsl:template match="/">
    <xsl:apply-templates />
  </xsl:template>

  <xsl:template match="employeehierarchy">
    <wml>
      <card id="employees">
        <p>Employees</p>
        <p>
        <xsl:apply-templates />
        </p>
      </card>
      <xsl:apply-templates mode="makeCards"/>
    </wml>
  </xsl:template>

  <xsl:template match="employee">

    <!--Build the wml cards-->

    <!--Build the card that lists the employees-->

          <a><xsl:attribute name="href">
             <xsl:text>#</xsl:text>
             <xsl:value-of select="emplast"/>
             </xsl:attribute>
             <xsl:value-of select="emplast"/>
          </a>
             <xsl:text>, </xsl:text>
             <xsl:value-of select="empfirst"/>
             <xsl:text> </xsl:text>
             <xsl:value-of select="empmiddle"/>
          <br/>
        <xsl:for-each select="employees">
          <xsl:apply-templates />
        </xsl:for-each>
  </xsl:template>

  <!--Build the cards that list each individual employee-->

  <xsl:template match="employee" mode="makeCards">
    <xsl:for-each select="//employee">
      <card><xsl:attribute name="id">
              <xsl:value-of select="emplast"/>
            </xsl:attribute>
            <p><xsl:value-of select="emptitle"/>
               <xsl:text> </xsl:text>
               <xsl:value-of select="empfirst"/>
               <xsl:text> </xsl:text>
               <xsl:value-of select="emplast"/>
            <br/>
            </p>
            <p>Position:<br/>
               <xsl:value-of select="empposition"/>
            <br/>
            </p>
            <p>Job Description:<br/>
               <xsl:value-of select="empdescription"/>
            <br/>
            </p>
            <p>Extension:<br/>
               <xsl:value-of select="empextension"/>
            <br/>
            </p>
      </card>
    </xsl:for-each>
  </xsl:template>

</xsl:stylesheet>

------------------------------------

Would it be better or worse to use:

------------------------------------

      ...
      </card>
      <xsl:call-template name="makeCards"/>
    </wml>
    ...

 and

  ...
  <!--Build the cards that list each individual employee-->

    <xsl:template name="makeCards">
      <xsl:for-each select="//employee">
      ...

-------------------------------------

Kinda long and drawn out for a general question, but I figured it was good
to give everyone exactly what I'm looking at :).

Thanks in advance,
R.Samways


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread