#2 modes vs. named groups

v1.0
closed-fixed
5
2003-01-06
2002-10-30
No

The mode attribute is defined for some elements
(stx:template, stx:process-*) currently. It seems this
is not necessary as modes don't play a relevant role in
an one-pass language. Moreover, matching constrains via
modes are orthogonal to another mechanism to limit the
number of matching templates - the grouping of templates.

If the common grouping is not enough, the naming of
groups and the adding of the 'group' attribute to
process-xxx instructions could help. This has been
discussed in the mailing list repeatedly with no clear
resolution yet.

Discussion

  • Petr Cimprich

    Petr Cimprich - 2002-11-07
    • status: open --> open-accepted
     
  • Petr Cimprich

    Petr Cimprich - 2002-11-07

    Logged In: YES
    user_id=149440

    It has been shown that either named groups or modes are
    necessary to process documents without nested structure,
    e.g. with empty tags indicating a status changes.

    I tend to prefer groups with qualified names.

     
  • Oliver Becker

    Oliver Becker - 2002-11-07

    Logged In: YES
    user_id=76736

    Simple modes as known from XSLT 1.0 can be simulated in STX
    fully by variables as follows:

    <stx:variable name="mode" />

    <stx:template match="*[$mode='mode1']"> ...

    <stx:template match="name[$mode='mode2']"> ...

    Moreover this approach is more flexible, since it allow
    multiple modes:
    <stx:template match="name[$mode='mode1' or $mode='mode2']"> ...

    and it is not necessary to add an explicit mode attribute in
    the process-*** statements because such a mode keeps its
    value during the processing until an <stx:assign name="mode"
    ....> is encountered.

    Conclusion: modes (as part of the language) are not
    necessary, whereas named groups allow structured programming
    in STX.

     
  • Petr Cimprich

    Petr Cimprich - 2002-12-05

    Logged In: YES
    user_id=149440

    It seems we have reached a consensus about the use of named
    groups. The names are QNames and are optional. The jumps
    invoke the need for a general parameter-passing mechanism:

    process-*/with-param -> template/param

     
  • Petr Cimprich

    Petr Cimprich - 2002-12-05
    • assigned_to: nobody --> pcimprich
     
  • Petr Cimprich

    Petr Cimprich - 2002-12-10
    • priority: 7 --> 2
    • labels: --> reminder (to do)
     
  • Petr Cimprich

    Petr Cimprich - 2002-12-10

    Logged In: YES
    user_id=149440

    Changed in the spec.

     
  • Petr Cimprich

    Petr Cimprich - 2002-12-10
    • status: open-accepted --> closed-fixed
     
  • Petr Cimprich

    Petr Cimprich - 2002-12-12
    • priority: 2 --> 5
    • status: closed-fixed --> open-rejected
     
  • Petr Cimprich

    Petr Cimprich - 2003-01-06

    Logged In: YES
    user_id=149440

    resolved: the winner is... groups

     
  • Petr Cimprich

    Petr Cimprich - 2003-01-06
    • status: open-rejected --> closed-fixed
     

Log in to post a comment.