RE: [xsl] more on Using apply-templates instead of for-each?

Subject: RE: [xsl] more on Using apply-templates instead of for-each?
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Tue, 15 Apr 2003 15:25:24 -0400
[Kathy Burke]

> Thank you Tom and Wendell...getting much clearer...
> 
> Tom, since you've also used value-of, may I assume this is 
> not a case where
> I can use apply-templates? Is that because I want the items 
> in table rows?
> 

Well, no, I just used as much of your code as possible.  You were just
displaying the text content, and that is the simplest way to do it.  If
you want to do more, you once again have to decide whether to do so
in-line or to invoke another template (and you might want to use
call-template instead of apply-templates, depending on the
circumstances).

Remember, simple is good, and so is being modular (i.e., using other
templates).  You want to try to make your code (yes, xslt is code!)
simple to understand and simple to modify, but the balance can shift
according to taste and circumstance.

I will often start out sketching a stylesheet using lots of value-ofs,
then later change them to apply-templates or call-templates as I fill in
the details.

Cheers,

Tom P

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


Current Thread