This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Re: Capturing/testing results of a boolean expression.
- From: Mike Brown <mike at skew dot org>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Fri, 2 Aug 2002 19:06:50 -0600 (MDT)
- Subject: Re: [xsl] Re: Capturing/testing results of a boolean expression.
- Reply-to: xsl-list at lists dot mulberrytech dot com
Edward L. Knoll wrote:
> I have a variable which will have a string value. I wish to compare
> that string value to another string value (which happens to be a literal
> value). I've done this directly in a xsl:if or xsl:when before, but now
> I'm trying to capture the results of the expression in a variable.
>
> <xsl:variable name="X" ..../>
>
> <xsl:variable name="flag" select="$X = 'literal-string-value'" />
That does in fact do exactly what you want.
Wherever that flag variable is in scope, it is a boolean object
and you can use $flag in an XPath expression as such.
You will need to post more details of how this is not doing what
you expect. What type of object is $X, for example?
- Mike
____________________________________________________________________________
mike j. brown | xml/xslt: http://skew.org/xml/
denver/boulder, colorado, usa | resume: http://skew.org/~mike/resume/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list