XForms - Current developments

Steven Pemberton, CWI, Amsterdam

Contents

Differences

This is from one of the appendices of the XForms 2 spec.

Differences

Lots of small changes, like new types, new functions.

Doesn't specify which version of XPath is used any more, but must be > 1

AVTs

These have been present in processors for a long time.

<output class="{xpath expr}" ref="..."/>

Label (etc) attributes

@label @alert @hint @help as alternatives

<input ref="h" label="height" alert="Must be positive"/>

Fallback on instance

<instance src="saved.xml">
   <game xmlns="">
      <score>0</score>
   </game>
</instance>

You can already do this, with submissions and events, but it's much more work.

Event

New event: xforms-refresh-done

Similar to xforms-ready: Tells you when the processor is idle. Good for generation-based programs, such as Game of Life.

whitespace property

<bind ref="email" whitespace="trim"/>
<bind ref="cc" whitespace="remove"/>
<bind ref="name" whitespace="collapse"/>

reset and retain instances

It's now possible to preserve the state of an instance, and restore it later.

<form> element

XForms has never had a root element, since it was always designed to be embedded in other languages.

Now it has one, for stand-alone processors.

<control/>

Embeds an XForm in another, with communication

<control label="before" resource="histogram.xf" ref="before"/>
<control label="after" resource="histogram.xf" ref="after"/>

Acts just like a regular control, with label, alert, etc.

@ref data is shared between the two, if one changes the data, the other sees the change.

In the embedded control

<shared ref="data" initial="external"/>

specifies the shared content, and where the initial values come from.

Events can be sent between the two.

If a form is not embedded, it performs normally.