Subject: Re: [xsl] Is a variable referencing a node From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx> Date: Sat, 27 Sep 2008 09:25:39 +0530 |
Please see, http://www.dpawson.co.uk/xsl/sect2/bool.html#d3065e16 Please read the last line of this FAQ point, "Result tree fragments are true because they always contain a 'root' node." On Sat, Sep 27, 2008 at 7:00 AM, David Frey <dpfrey@xxxxxxx> wrote: > I have an XSLT 1 question. > > Say I have: > > <xsl:variable name="foo"> > <xsl:choose> > <xsl:when test="$aVar='someFlag'"> > <xsl:value-of select="/path/to/some/element"/> > </xsl:when> > <xsl:otherwise> > <xsl:value-of select="/path/to/another/element"/> > </xsl:otherwise> > </xsl:variable> > <xsl:choose> > <xsl:when test="$foo"> > <xsl:value-of select="$foo"/> > </xsl:when> > <xsl:otherwise>--</xsl:otherwise> > </xsl:choose> > > > > Currently, I never get "--" as my output even if $aVar is set to > 'someFlag' and the element at "/path/to/some/element" does not exist. > > Can someone explain where I went wrong? > > Thanks, > David -- Regards, Mukul Gandhi
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Is a variable referencing a n, David Frey | Thread | Re: [xsl] Is a variable referencing, Dimitre Novatchev |
[xsl] Is a variable referencing a n, David Frey | Date | Re: [xsl] Is a variable referencing, Dimitre Novatchev |
Month |