I am using XPATH to work out if my parameter $test exists.
I am using the XPATH builder in ALtova Stylevision and thought I could use something like
exists ( $blah)
or exists ( string($blah) )
But this ends with
" Undefined variable in expression test="exists( string( $blah) )""
The issue is that sometimes the parameter will exist, and sometimes it won't. I don't want to have to hardcode in a blank parameter!
Is there a way I can say "Check if the parameter XXXX exists" before I use it? It's frustrating as I know how to do this in pretty much every other programming language
Parameter defined:
<xsl:param name="blah"> some text </xsl:param>
These parameters are read in from a seperate file "parameters.xslt". This file may or may not exist, depending on the scenario. I need to check the param actually exists before I attempt to use it.
Basically, if you are writing XSLT then you are expected to know what variables have been declared. You're trying to work with some kind of development model where people writing different modules of the stylesheet don't have full knowledge of each other's code, and XSLT isn't designed to work with that model.
XSLT is hardly unique in this: you won't find anything in a Java method that allows the writer of the method to ask "how many arguments have been supplied by the caller?". If insufficient arguments have been supplied, the code simply won't compile.