// Define the form controls content set.
// See http://www.w3.org/TR/2003/REC-xforms-20031014/slice8.html#id2625797
FORM_CONTROLS.add(input).add(secret).add(textarea).add(submit)
.add(select).add(select1);
CompositeModel UI_COMMON = choice();
// Add the form controls to the XHTML 2 Structural and Text content
// sets.
// See http://www.w3.org/TR/2006/WD-xhtml2-20060726/mod-xforms.html#XForms_Form_Controls
xhtml2.STRUCTURAL.add(FORM_CONTROLS);
xhtml2.TEXT.add(FORM_CONTROLS);
// todo this has been commented out because the code cannot deal with
// todo this correctly. Once LabelStrategy has been changed to collect
// todo not just text but an OutputBuffer containing text inline markup
// todo then the following can be uncommented.
// // Add the XHTML 2 Text content set to UI_INLINE.
// // See http://www.w3.org/TR/2006/WD-xhtml2-20060726/mod-xforms.html#XForms_Form_Controls
// UI_INLINE.add(xhtml2.TEXT);
//
// // Exclude any form controls from appearing within other form elements
// // that can contain text.
// UI_INLINE.exclude(FORM_CONTROLS);
// (PCDATA|UI_INLINE)*
ContentModel MIXED_UI_INLINE = bounded(
choice().add(PCDATA).add(UI_INLINE));
label.setContentModel(MIXED_UI_INLINE);
// label, (UI_COMMON)*
CompositeModel CONTROL_MODEL =
sequence().add(label).add(bounded(UI_COMMON));
INPUT_CONTENT.add(UI_COMMON);
input.setContentModel(sequence().add(label).add(bounded(INPUT_CONTENT)));
secret.setContentModel(CONTROL_MODEL);
CompositeModel SUBMIT_CONTENT = choice().add(setvalue).add(UI_COMMON);
submit.setContentModel(sequence().add(label).add(bounded(SUBMIT_CONTENT)));
textarea.setContentModel(CONTROL_MODEL);
// (PCDATA)
value.setContentModel(PCDATA);
setvalue.setContentModel(PCDATA);
// label, value, (UI_COMMON)*
item.setContentModel(
sequence()
.add(label)
.add(value)
.add(bounded(UI_COMMON)));
CompositeModel LIST_UI_COMMON = choice().add(item);
// label, (LIST_UI_COMMON)+, (UI_COMMON)*
CompositeModel SELECT_MODEL =
sequence()
.add(label)
.add(bounded(LIST_UI_COMMON).atLeastOne())
.add(bounded(UI_COMMON));
select.setContentModel(SELECT_MODEL);
select1.setContentModel(SELECT_MODEL);
// ====================================================================
// Group Module
// ====================================================================
// (FORM_CONTROLS|group|UI_COMMON)
CompositeModel GROUP_CHOICE =
choice().add(FORM_CONTROLS).add(group).add(UI_COMMON);
group.setContentModel(
sequence()
// label?,
.add(bounded(label).optional())