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

RE: Clearing up XSL-speak

Subject: RE: Clearing up XSL-speak
From: "Andreas L. Delmelle" <a_l.delmelle@xxxxxxxxxx>
Date: Fri, 12 Dec 2003 18:18:27 +0100
rat clearing
> -----Original Message-----
> From: JCS
>
> SELECT VS. FIND
>
<snip />
> I submit it's better to use select as it's what the syntax is but
> one could
> describe it as a find, or a query, that uses the syntax "select".
>

This one is particularly interesting... Compares better with SQL, it
definitely makes sense (to me) to draw this comparison :

<xsl:apply-templates select="foo" />

...

<xsl:template match="foo">
  <!-- do stuff -->
</xsl:template>

This combination means something like (drastically simplified):

SELECT f(foo) FROM sourcedoc WHERE foo=...;

Helps to explain the impossibility to create real-time loops like in
imperative programming languages. In SQL you define the main condition(s) in
the WHERE-clause. Once a record/node satisfies these criteria, it will end
up in the resultset. You can use an if(when;true;false)-expression (--or
decode(val1;val2;val1=val2;val3;val1=val3...;default) for Oracle PL/SQL) in
the SELECT to create subdivisions in the selected data, however these
expressions cannot be used to filter out any more records. It's kind of
analogous to the 'select' in xsl:apply-templates/xsl:for-each.

You _can_ use an xsl:if/xsl:choose inside a template/for-each, but if you
find yourself writing a lot of empty xsl:otherwise's, you need to consider
the possibility of filtering out the nodes beforehand, using XPath, or, if
they're not empty, just write a different template (or a different mode of
the same template).

>
> --
> Hating somebody is like burning down a house to get rid of a rat.
> -- unknown
>

A very good one, indeed! :)

Cheers,

Andreas


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


Current Thread
  • Clearing up XSL-speak, (continued)
        • JCS - Wed, 10 Dec 2003 01:25:17 -0500 (EST)
        • David Carlisle - Wed, 10 Dec 2003 05:25:49 -0500 (EST)
        • Peter Hickman - Wed, 10 Dec 2003 10:49:24 -0500 (EST)
        • JCS - Fri, 12 Dec 2003 00:26:29 -0500 (EST)
        • Andreas L. Delmelle - Fri, 12 Dec 2003 12:28:04 -0500 (EST) <=
        • Michael Kay - Wed, 10 Dec 2003 05:48:14 -0500 (EST)

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.