[Home] [By Thread] [By Date] [Recent Entries]
Hi Robert,
On 11/24/06, Robert Koberg <rob@xxxxxxxxxx> wrote: Dimitre Novatchev wrote: > Briefly, > > 1. Indentation. A stylesheet is an xml document, so the same > formatting guidelines apply. > > 2. Limited lines' width so that the whole code can be read on the > screen without horizontal scrolling.
Dr. Kay already explained that this is *one* possible style, which already is used by the vocabulary of xml schema. Therefore, we cannot completely avoid it, even if we did want to. Using hyphens or underscores to separate words in a name may be more readable, but has the side effect of occupying more space and requiring more keystrokes.
This is XSLT-style code: <xsl:choose>
<xsl:when test="not($pList)">
<xsl:copy-of select="$pA0"/>
</xsl:when>
<xsl:otherwise> <xsl:variable name="vFunResult">
<xsl:apply-templates select="$pFunc[1]" mode="f:FXSL">
<xsl:with-param name="arg0" select="$pFunc[position() > 1]"/>
<xsl:with-param name="arg1" select="$pA0"/>
<xsl:with-param name="arg2" select="$pList[1]"/>
</xsl:apply-templates>
</xsl:variable> <xsl:call-template name="foldl">
<xsl:with-param name="pFunc" select="$pFunc"/>
<xsl:with-param name="pList" select="$pList[position() > 1]"/>
<xsl:with-param name="pA0" select="$vFunResult/node()"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>and this is the same in XPath-style code: <xsl:sequence select=
"if (empty($pList))
then
$pA0
else
f:foldl($pFunc,
f:apply($pFunc, $pA0, $pList[1]),
$pList[position() > 1]
)"/>
|

Cart



