Just tossing a few ideas at the list before going home from work.

==========================================
=== A few possible selection semantics ===

(A)
if ((boolean)expression) ... then ...

(B)
if ((boolean)expression) ... then ... else ...

(C)
if ((boolean)expression_1) ... then ...
elseif ((boolean)expression_2) ...

(D)
if ((boolean)expression_1) ... then ...
elseif ((boolean)expression_2) ... else ...

(E)
// (Optional) Fall-through to contents of next case if
// there is no "break" statement in case that matched.
switch ((String|Int|etc.)expression) {
  case value_1: ...
  case value_2: ...
  default: ...
}

(F)
// (Optional) Fall-through to contents of next case if
// there is no "break" statement in case that matched.
select_first_true_expression {
  case ((boolean)expression_1): ...
  case ((boolean)expression_2): ...
  default: ...
}

(G)
select_all_true_expressions {
  case ((boolean)expression_1): ...
  case ((boolean)expression_2): ...
  default: ...
}

===

The union model currently implements semantic (E), with a
string-valued expression and no fall-through logic.
The semantic (F), without fall-through logic, has been
discussed on this list as a possible alternative.

Lets pause to choose the selection of semantics that will
most naturally support simple forms, recursive forms, and
eventually multi-forms with multiple nested and overlapping
bindings and templates:
  http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=106965619705596&w=2

=========================================
=== Templates, Navigation, Evaluation ===

Separate navigation from evaluation and expression of values,
similar to how the binding currently operates.

Example adapting the "context" idea from the binding:

  <wt:context select="some-repeater-id">
    <wt:label/>
    <wt:context select="rows">
      <wt:context select="row">
        <wt:context select="first-widget-id">
          <wt:label/>
          <wt:value/>
        </wt:context>
        <wt:context select="second-widget-id">
          <wt:label/>
          <wt:value/>
        </wt:context>
      </wt:context>
    </wt:context>
  <wt:context>

Same semantics as above, but more expressive syntax:
(This syntax allows some type checking to be performed.)

  <wt:repeater id="some-repeater-id">
    <wt:label/>
    <wt:apply-templates id="rows"/>
    <wt:rows>
      <wt:row>
        <wt:widget id="first-widget-id">
          <wt:label/>
          <wt:value/>
        </wt:widget>
        <wt:widget id="second-widget-id">
          <wt:label/>
          <wt:value/>
        </wt:widget>
      </wt:row>
    </wt:rows>
  </wt:repeater>

Allow model, binding, and template fragments to be
associated with each other.  This leads to more concise
bindings and templates by borrowing the "apply-templates"
concept from XSL.

Progressively shorter template examples:
(A similar set of examples could be created
for bindings, using "apply-bindings".)

  <wt:repeater id="some-repeater-id">
    <wt:label/>
    <wt:apply-templates id="rows"/>
    <wt:rows>
      <wt:row>
        <wt:apply-templates select="first-widget-id"/>
        <wt:apply-templates select="second-widget-id"/>
      </wt:row>
    </wt:rows>
  </wt:repeater>

  <wt:repeater id="some-repeater-id">
    <wt:label/>
    <wt:apply-templates select="rows"/>
  </wt:repeater>

  <wt:apply-templates select="some-repeater-id"/>

  <wt:apply-templates select="form"/>

  <!--
  One more example: No explicit template file supplied.
  This would cause cforms to implicitly "apply-templates"
  the whole page into existence, without the need to
  create a form-specific template file.
  -->

========

More ideas waiting in line for later...

--Tim Larson


__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

Reply via email to