links for 2009-12-23

December 24, 2009
  • <blockquote>
    <p>Take a look at the
    XSLT fragement below:
    </p>

    <pre>&lt;xsl:choose&gt;
    &lt;xsl:when test="$count &amp;gt; 1"&gt;
    &lt;xsl:call-template name="by-columns"&gt;
    &lt;xsl:with-param name="column-count" select="$count"/&gt;
    &lt;/xsl:call-template&gt;
    &lt;/xsl:when&gt;

    &lt;xsl:otherwise&gt;
    &lt;para&gt;
    &lt;text&gt;No columns&lt;/text&gt;
    &lt;/para&gt;
    &lt;xsl:otherwise&gt;

    &lt;/xsl:choose&gt;</pre>

    <p>
    In XSLTXT it can be written as
    </p>

    <pre>choose
    when .test "$count &gt; 1"
    call "by-columns" ("column-count":"$count")
    otherwise
    &lt;para&gt;
    "No columns"</pre>

    <p>
    XSLTXT increases the signal to noise ratio in XSLT
    stylesheets so that they are easier to write and hopefully
    easier to read. </p>
    </blockquote>
    via http://www.scottsweeney.com/projects/slip/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: