- From: Ryan Tomayko <ryant@mad.scientist.com>
- Date: Tue, 4 Sep 2001 17:08:18 -0400
- To: <www-forms@w3.org>
Is there currently anyway that a <switch> element can be used in the more
programming language traditional sense? For instance, let's suppose I wanted
to display a section of markup based on whether some value in my instance
document was set to 1, 2, or something else.
<xf:switch id="sw" ref="foo/bar/showit" default="def">
<xf:case test="1" id="case1">
...
</xf:case>
<xf:case test="2" id="case2">
...
</xf:case>
<xf:case id="def">
...
</xf:case>
</xf:switch>
This would be equivelant to something that looked like this in Java:
switch(value) {
case 1:
doSomething();
break;
case 2:
doSomethingElse();
break;
default:
doDefault();
}
I realize that there is no test attributes defined for case elements, so how
would I implement this functionality using a <toggle>? Also, what is the
value of having single-node-binding attributes on a <switch> element if this
is not possible?
Thanks,
- Ryan
Received on Tuesday, 4 September 2001 17:16:03 UTC