W3C home > Mailing lists > Public > public-forms@w3.org > February 2012

Reducing the amount of XForms markup by using more attributes instead of nested elements

From: Erik Bruchez <erik@bruchez.org>
Date: Mon, 27 Feb 2012 17:05:17 -0800
Message-ID: <CAAc0PEUSCLUgQfHeK9bwqOHusaCj8Uad_3CZrgHyDnmv2TwQJw@mail.gmail.com>
To: public-forms@w3.org

I think that we touched on this in the past, but I don't think we have
formally decided anything. For an example, I found myself writing this

<xf:select1 ref="lang">

What about something like this instead:

<xf:select1 ref="lang" label="Lang:">
    <xf:item label="English" value="en"/>
    <xf:item label="French" value="fr"/>

Now this is a simple case where all the values are constants, but
there are ways to introduce dynamic values, for example:

- introduce `labelref` or `label-ref`
- use AVTs, e.g.: label="{my-label}"

Also, the choice of the `value` attribute is debatable, as `value`
currently is an XPath expression. We could write value="'en'" or
simply keep the value as the text value of the element.

So the exact details are TBD, but the fact remains that if you write
XForms by hand you often have to write way more markup than needed.
Since mainstream programming is tending towards more conciseness, we
should consider making further efforts in that direction as well.

Received on Tuesday, 28 February 2012 01:06:05 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:48:49 UTC