[OpenAjaxIDE] <enum> and/or <options>
Jon Ferraiolo
jferrai at us.ibm.com
Wed Jul 23 17:08:21 PDT 2008
During our phone call on Tuesday, I promised to make a proposal around the
<enum> and <options> element because I observed some ugly deep nesting of
XML elements due to the fact that the following markup can happen according
to the current spec:
<api>
__<enums>
____<enum>
______<options>
________<option>
One observation is that, according to the current version of our schema,
<enums> is optional, but you must have an <options> parent for any <option>
elements. During the phone call, I wondered whether it made sense to
consolidate <enum> and <options> into a single element.
After thinking things through, here is what I propose, which represents
very minor changes. My proposal is simply to allow <enum> and <property>
elements to have <option> elements as direct children instead of requiring
them to be embedded inside of a parent <options> element.
To illustrate, <enum> children could have either an <options> child element
or any number of <option> elements (or both). Therefore, any of the
following would be valid:>
<enum>
<options multiple="true"> <!-- If you want to allow multiple select, you
would have to use an 'options' element -->
<option label="Red" value="1"/>
<option label="Blue" value="2"/>
</options>
</enum>
or
<enum> <!-- Only if you don't need to set one of the properties on the
'options' element -->
<option label="Red" value="1"/>
<option label="Blue" value="2"/>
</enum>
or
<enum> <!-- Funky, bad practice, but valid according to the current rules
-->
<options multiple="true">
<option label="Red" value="1"/>
</options>
<option label="Blue" value="2"/>>
</enum>
Inside of a <property> element, for consistency with the rules on plurals
and singulars, we should allow any of the following (the same as above):
<property>
<options multiple="true"> <!-- If you want to allow multiple select, you
have to have an 'options' element -->
<option label="Red" value="1"/>
<option label="Blue" value="2"/>
</options>
</property>>
or
<property>
<option label="Red" value="1"/>>
<option label="Blue" value="2"/>
</property>
or
<property> <!-- Funky, bad practice, but valid according to the current
rules -->
<options multiple="true">
<option label="Red" value="1"/>
</options>
<option label="Blue" value="2"/>>
</property>
Let's talk about this at our next phone call.
Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openajax.org/pipermail/ide/attachments/20080723/e41ee2be/attachment.html
More information about the IDE
mailing list