cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <>
Subject xforms - inline values & fix names
Date Mon, 06 Aug 2001 14:09:44 GMT

although I've said that doing this with xslt is feasible I think I was

So here is a transformer that does a) handle the complete xform
binding spec and adds instance data as <value/> child element to form
controls and b) adds a @name attribute to them containing the form
name + "/" + path to instance data (e.g. name="order_form/address/street")

It does not remove anything from the document, e.g. form declarations
or @refs.

The package name is a temporal convenience and will change.

I did waste quite some time toying with an DTM representation, since
this transformer is quite slow and DTM looked like it would speed it
up a lot. E.g. creating the cached form declaration took half the
time. Unfortunately I had to find out the hard way that a number of
important API calls are not implemented yet.... :-(

Since this transformer caches form declarations which also contain the
model necessary for validation, I think it would be nice to "register"
this model (+submitInfo) somewhere so that it is available when
validation takes place. This doesn't need to be session bound (doesn't
register instance data).

This information would be useful also when determining which form has
been submitted.

Caching is done only during the lifetime of a transformer instance as
I have no idea how to decide easily if a cached form declaration &
instance data is still valid. Ideas?

BTW if I understand the xforms WD correctly, form controls need to set
the default namespace or child elements like <caption/>, <hint/>
&c. need to explicitly carry their namespace. So your sample xform.xml
needs to be changed:

      <xform:textbox ref="order/city" xform="orderForm">


      <xform:textbox ref="order/city" xform="orderForm" xmlns="">

I will next look into such a "registry" that keeps track of xform
declarations and provides them to a validator. Obviously, I will go
and see if I can use the code you posted earlier :-)


C h r i s t i a n       H a u l
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

View raw message