xsl-list
[Top] [All Lists]

RE: [xsl] test context node existence

2008-06-27 14:31:42
From: max toro q [mailto:maxtoroq(_at_)gmail(_dot_)com]
Sent: Friday, June 27, 2008 5:26 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] test context node existence

Hello list,
I have a stylesheet that sometimes run using an initial context node
and other times using an initial named template.
What I need is a way to test if a context node exists, or else I get a
dynamic error when a call apply-templates, or when I do any kind of
node test.

Why can't you say:

<xsl:if test="exists(foo:node)">
  <xsl:apply-templates select="foo:node" />
</xsl:if>


Andy.


--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>