xsl-list
[Top] [All Lists]

RE: Number of times apply-templates gets executed.

2003-01-07 12:26:20
Viral,

This is actually a pretty nice example of how XSL-think is different from the kind of thinking that is useful (and necessary) in procedural languages:

At 12:07 PM 1/7/2003, you wrote:
So I was thinking that if I could test and see if the displayCommunity
template got applied or not then that will tell me we found a record or not.
But I am not sure how to determine how many times that template was applied
or not.

Mmhm. In other words, you're asking for a side-effect (some kind of state that can tell you whether a given template was applied or not). But the same logic could be addressed by asking "does a matching record exist in the source?", and if not, outputting the error message.

This question is very easy to ask in XSLT. And notice it is actually a more straightforward question -- being a question about your data, not your process. It's a nice little lesson, especially for those just getting their feet wet with XSLT.

Please post again with a short example showing your source code, if you need more concrete suggestions.

Cheers,
Wendell



======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


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