G
Gadrin77
as a newbie to XSL, is it possible to mimic a SELECT/CASE statement
using
XSL?
I tried a quickie and I kept getting errors either using PARAM or
WITH-PARAM
in the wrong place or VARIABLE. I ended up using .createProcessor and
doing
all the work behind the scenes in my programming language, then using
the
..addParameter to pass the values.
I wanted to select data, then set variables using XSL:CHOOSE and
XSL:IF based
on the values found in the data, then further alter these farther down
in the XSL with math.
pseudo-code:
xml:
<main class="1">
XSL Logic...
if class == 1
xsl-var1 = 10
xsl-var2 = 20
else
xsl-var1 = 50
xsl-var2 = 60
endif
myNewNumber = "value-of xsl-var1 + value-of xsl-var2"
'convert myNewNumber to kilograms (was pounds)
myNewNumber = myNewNumber * 2.2
etc, etc.
I'm not sure the value of a XSL:VARIABLE can be redefined.
sorry for the fuzziness, any help is greatly appreciated.
using
XSL?
I tried a quickie and I kept getting errors either using PARAM or
WITH-PARAM
in the wrong place or VARIABLE. I ended up using .createProcessor and
doing
all the work behind the scenes in my programming language, then using
the
..addParameter to pass the values.
I wanted to select data, then set variables using XSL:CHOOSE and
XSL:IF based
on the values found in the data, then further alter these farther down
in the XSL with math.
pseudo-code:
xml:
<main class="1">
XSL Logic...
if class == 1
xsl-var1 = 10
xsl-var2 = 20
else
xsl-var1 = 50
xsl-var2 = 60
endif
myNewNumber = "value-of xsl-var1 + value-of xsl-var2"
'convert myNewNumber to kilograms (was pounds)
myNewNumber = myNewNumber * 2.2
etc, etc.
I'm not sure the value of a XSL:VARIABLE can be redefined.
sorry for the fuzziness, any help is greatly appreciated.