View Single Post
  #1 (permalink)  
Old June 10th, 2009, 04:39 PM
iceandrews iceandrews is offline
Authorized User
Points: 137, Level: 2
Points: 137, Level: 2 Points: 137, Level: 2 Points: 137, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2008
Location: , OH, USA.
Posts: 33
Thanks: 5
Thanked 1 Time in 1 Post
Send a message via ICQ to iceandrews Send a message via AIM to iceandrews Send a message via Yahoo to iceandrews
Default check if a variable has been declared.

Is there a method that allows you to check to see if a variable/parameter has been declared before calling it? Obviously calling an undeclared variable/parameter results in an error.

Logically speaking I'm looking for something along these lines.

Code:
 
<xsl:choose>
     <xsl:when test="$Test"/>
     <xsl:otherwise/>
</xsl:choose>
A parallel function that I have in mind is the "doc-available ()" function. Using this I can continue processing even if the document URI doesn't resolve. I'd like a similar functionality but with a variable. (Or perhaps even a <xsl:call-template/>. Check if there is a named template that exists with that name before calling it.)

I'm using XSLT 2.0 & Saxon-9SA

Thank you much!
Reply With Quote