testing for presence of a variable
I have a crucial global variable in my stylesheets which goes through a document a collects all the citation references. This works well when I have self-contained documents. However, in the case of the manuscript I just finished, I needed to first include the individual chapters into a variable, and then run the stylesheets on that.
To get it to work thus required adding the $chapters variable to the path.
<xsl:variable name="citerefs" select="($chapters)//db:biblioref/@linkend"/>
If I then run the stylesheets on a standalone document that doesn't include this variable, it fails.
So I'm wanting to do something like this:
<xsl:variable name="root-node" select="if ($chapters) then ($chapters) else ()"/>
<xsl:variable name="citerefs" select="($root-node)//db:biblioref/@linkend"/>
... but get an error about the missing $chapters.
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format