I have two variables declared var1 and var2. I am trying to use a choice element and select the value-of var2 if value-of var1 is null. Haven't had any success. Any ideas are appreciated... Thanks.
- madhav
[Map edited code to reduce page width] [ November 05, 2002: Message edited by: Mapraputa Is ]
Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
1) You'd better post the entire code, instead of code snippet 2) Remember, xsl:variable select="something" is actually constant. You cannot change it. 3) xsl aram select="something" is default value, it can be replaced by real value. I don't know what you want to do.
I agree with the const thingy. I am not changing the values of var1 and var2. In programming language terms:
Give that var1 and var2 are declared as xsl:variables with appropriate "select" stmts to valid XPath locations, how should I write above rule in XSL...... Thanks. - madhav.........try teaching XSL to a programmer!!!
Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Okay, I found that there is a string-length function and then what........ string-length('$var1') doesn't seem to work..... Any help please....... - madhav
Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
What problem are you having with string-length() ? When I declared xsl:variable, the test never worked. I changed it to xsl:param and my changes seem to work. Now I am attempting to print the value of the lenght...... <xsl:if test="string-length(normalize-space($param1)) > 1"> xyz = string(string-length(normalize-space($param1))) </xsl:if>
Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Hey, it works!!! I used : to escape ":". Excellent!!! I'll not fix the other posts by me. Other people will learn the lesson by comparison. [ November 05, 2002: Message edited by: Roseanne Zhang ]