[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Clearing up XSL-speak
> -----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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|