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

Best practices - using vars

Subject: Best practices - using vars
From: xptm@xxxxxxx
Date: Mon, 23 Aug 2004 17:29:24 +0100
xsl best practices
Hi again:

Using some "best practices" in order to achieve both readability and
performance, i ended up using a *lot* of vars. It really improves readability
but don't know about performance...

What is the cost of using vars? I'm doing this, for instance:

  <xsl:variable name="xtabnode">
    <xsl:value-of
select="document(concat('.\DicionarioXml\',$MasterTable,'.xml'))/Estrutura/Ta
belas/Tabela[Nome=$MasterTable]"/>
  </xsl:variable>
  <xsl:variable name="sqlInsert">
    <xsl:value-of select="sql:getStatement($MasterTable, $sql, $where,
$where,
$xtabnode, 'I' )" />
  </xsl:variable>
  <xsl:variable name="sqlUpdate">
    <xsl:value-of select="sql:getStatement($MasterTable, $sql, $where,
$where,
$xtabnode, 'U' )" />
  </xsl:variable>
  <xsl:variable name="sqlDelete">
    <xsl:value-of select="sql:getStatement($MasterTable, $sql, $where,
$where,
$xtabnode, 'D' )" />
  </xsl:variable>

  <xsl:template match="/">
    <XPage class="Tester" name="Tester"
    	sqlInsert = "{$sqlInsert}"
    	sqlUpdate = "{$sqlUpdate}"
    	sqlDelete = "{$sqlDelete}" >
(...)
     </XPage>
  </xsl:template>

I can have this instead:

 <xsl:template match="/">
    <XPage class="Tester" name="Tester"
    	sqlInsert = "{sql:getStatement($MasterTable, $sql, $where, $where,
$xtabnode, 'I' )}"
    	sqlUpdate = "{sql:getStatement($MasterTable, $sql, $where, $where,
$xtabnode, 'U' )}"
    	sqlDelete = "{sql:getStatement($MasterTable, $sql, $where, $where,
$xtabnode, 'D' )}" >

I tend to do this a lot, so creating a lot of vars.

Is it one better over the other ?

Thanks.






O SAPO ja esta livre de vmrus com a Panda Software, fique vocj tambim!
Clique em: http://antivirus.sapo.pt

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.