[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Evaluating using xsl:if
> i have a constant declared as follows: > <xsl:variable name="account"> > on > </xsl:variable> > in the same xsl if i use the following the condition is not > evaluated to > true. can anybody answer my question.Is there any way to test this > condition? > > <xsl:if test="'{$account}'='on'"> 1. get rid of the curly brackets and the first pair of quotes: <xsl:if test="$account='on'"> (Curly brackets are never used inside an XPath expression, they are only used to nest an XPath expression within an attribute value that is designated as an attribute value template). 2. get rid of the leading and trailing spaces, either by declaring the "constant" as <xsl:variable name="account">on</account> or by using normalize-space() in the comparison. Mike Kay XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|