[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Is there a way I can condition a variable on the presence (or absence) of another 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.
Any suggestions?
Bruce
[xsl] testing for presence of a variable
Subject: [xsl] testing for presence of a variable From: Bruce D'Arcus <bdarcus@xxxxxxxxx> Date: Fri, 6 May 2005 18:59:30 -0400 |
Is there a way I can condition a variable on the presence (or absence) of another 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.
Any suggestions?
Bruce
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] minor grouping issue, Michael Kay | Thread | Re: [xsl] testing for presence of a, David Carlisle |
RE: [xsl] minor grouping issue, Michael Kay | Date | Re: [xsl] minor grouping issue, Bruce D'Arcus |
Month |