[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

[2.7.7] : Direct Processing

Subject: [2.7.7] : Direct Processing
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxx>
Date: Wed, 09 Sep 1998 20:26:36 -0400
direct processing
Is there a difference between the example shown in 2.7.7:

<xsl:template match="/">
  <HTML>
    <HEAD>
      <TITLE>Customers</TITLE>
    </HEAD>
    <BODY>
      <TABLE>
    <TBODY>
      <xsl:for-each select="customers/customer">
        <TR>
          <TH>
        <xsl:process select="name"/>
          </TH>
          <xsl:for-each select="order">
        <TD>
          <xsl:process-children/>
        </TD>
          </xsl:for-each>
        </TR>
      </xsl:for-each>
    </TBODY>
      </TABLE>
    </BODY>
  </HTML>
</xsl:template>

and (preserving the indentation):

<xsl:template match="/">
  <HTML>
    <HEAD>
      <TITLE>Customers</TITLE>
    </HEAD>
    <BODY>
      <TABLE>
    <TBODY>

    <xsl:process select="customer"/>
    </TBODY>
      </TABLE>
    </BODY>
  </HTML>
</xsl:template>

      <xsl:template match="customers/customer">
        <TR>
          <TH>
        <xsl:process select="name"/>
          </TH>
        </TR>
      </xsl:template>

          <xsl:template match="order">
        <TD>
          <xsl:process-children/>
        </TD>
          </xsl:template>

?  If not, is the "for-each" considered just an alternative representation
of the same or is there somehow some performance difference?  And if not,
are there two techniques because one technique should be deprecated in
deference to the other?

I can see some users might prefer for-each over template because the root
template could mimic the output almost in the entirety (as your very
illustrative example shows) ... could this be the only "benefit"?

........ Ken


--
G. Ken Holman               mailto:gkholman@xxxxxxxxxxxxxx
Crane Softwrights Ltd.  http://www.CraneSoftwrights.com/s/
Box 266,                                V: +1(613)489-0999
Kars, Ontario CANADA K0A-2E0            F: +1(613)489-0995
Training:   http://www.CraneSoftwrights.com/s/schedule.htm
Resources: http://www.CraneSoftwrights.com/s/resources.htm
Shareware: http://www.CraneSoftwrights.com/s/shareware.htm


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.