xsl-list
[Top] [All Lists]

Re: Catch ALL | Failed template rule

2005-03-22 00:12:57
I know that the OP meant something completely different, but probably
what seems as an appropriate  answer to the question expressed in the
title of this thread is:

   the builtin rules.

It is a good practice to have them explicitly in one's code (with the
least priority possible) and to put breakpoints on them (in a good
XSLT IDE with a debugger), whenever one gets unexpected output that no
other template is supposed to produce.

I find this meaning of "catch all" more natural and intuitive.


Cheers,
Dimitre Novatchev.

 


On Mon, 21 Mar 2005 08:03:06 -0700, Karl Stubsjoen 
<kstubs(_at_)gmail(_dot_)com> wrote:
I'd like a catch ALL template rule, actually a catch NOT template
rule.  In an effort to check for the existence of a select, I have
setup a match template rule that simply returns "1" for a match.  So I
have:

<xsl:template match="record" mode="recordexists">
<xsl:text>1</xsl:text>
</xsl:template>

The failed select would need to return a "0".  So I need a match that
simply returns 0.

So something like:

<xsl:template match="not(record)" mode="recordexists">
<xsl:text>0</xsl:text>
</xsl:template>

(which is not a legal match statement, but that is what I need).  I'm
sure there is a way, and I'm sure it is obvious!  Just not coming to
me.

Thanks,
Karl

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--