W3C home > Mailing lists > Public > www-forms@w3.org > September 2001

using <switch> in the more traditional sense

From: Ryan Tomayko <ryant@mad.scientist.com>
Date: Tue, 4 Sep 2001 17:08:18 -0400
To: <www-forms@w3.org>
Message-ID: <000301c13585$b91c80e0$3a271841@SPOCK>

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 test="2" id="case2">
	<xf:case id="def">

This would be equivelant to something that looked like this in Java:

switch(value) {
    	case 1:
	case 2:

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?

- Ryan
Received on Tuesday, 4 September 2001 17:16:03 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:04 UTC