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/Tabelas/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 já está livre de vírus com a Panda Software, fique você também!
Clique em: http://antivirus.sapo.pt