W3C home > Mailing lists > Public > www-forms@w3.org > March 2001

templates vs. components

From: Schulze, Matthias <schulze@dresden-informatik.de>
Date: Thu, 29 Mar 2001 11:18:42 +0200
Message-ID: <7140E412EB5ED411B8720050BF1123B00CCCC9@www.dresden-informatik.de>
To: www-forms@w3.org
Has the working group considered <xform:template match=""> as an alternative
to <xform:component>?

I think that the template/match model of XSL might be very useful for XForms
as well, especially as a means for componentization and repeating

In my opinion the current spec has the drawback to require the UI to be
distinctively described all the way down from the root of the model down to
the leafes (tell me if I'm wrong). 
Using template/match allows to create components that are automatically
instantiated without the need of an explicit <xform:use-component>. 

for instance we might:

 - have only one template that renders any number of 
   different model items in a common way (match="*")

 - have one template for each datatype
   (e.g. match="*[type='string']"

 - have different templates depending on locales
   (e.g. match="address[property(locale)='US']"

The match attribute's XPath expression must have access to both, the model
and the instances. This allows to precisely act upon the final form
presentation with a minimum effort of markup (everybody who uses XSL
probably knows how neat it works).

I'm not sure which technique XForms processor implementors are expected to
use, but as XForms now includes XPath, XSL would probably be the best
choice. So <xform:template> may be processed directly through <xsl:template>
somehow. This magnificently reduces coding and processing efforts. Isn't it
a great deal to use the same syntax in different namespaces and for
completely differnt tasks with a predictable effect?

Thanks, Matthias
Received on Thursday, 29 March 2001 04:30:42 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:04 UTC