On 08/01/2008, Colin Adams <colinpauladams(_at_)googlemail(_dot_)com> wrote:
If you want to prevent the global variable evaluation to
throw an error, use something like this:
<xsl:variable name="v" as="node()"/>
<ex:error-safe>
<ex:try>
<xsl:sequence select="error()"/>
</ex:try>
<ex:catch>
<xsl:sequence select="'alternative value'"/>
</ex:catch>
</ex:error-safe>
</xsl:variable>
The problem with this is that, in general, you don't know whether or
not it is right to catch the error. The accessor of the variable might
be in a different module, by a different author.
You won't always be able to guess what is best for the user of the module.
--~------------------------------------------------------------------
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>
--~--