RE: [xsl] test context node existence

Subject: RE: [xsl] test context node existence
From: "Houghton,Andrew" <houghtoa@xxxxxxxx>
Date: Fri, 27 Jun 2008 17:31:12 -0400
> From: max toro q [mailto:maxtoroq@xxxxxxxxx]
> Sent: Friday, June 27, 2008 5:26 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> 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.

Current Thread