Need better usage of QName datatypes in XForms submissions

The current XForms submission has an attribute called 
includenamespacesprefixes.

If you leave out this attribute, the submitted instance may receive 
numerous namespaces declarations from the containing document that are not 
declared on the root element of the instance itself.

If you add includenamespaceprefixes="", then the list of namespaces added 
to the root element is attenuated to those that are *visibly utilized*.

If you add a space separated list, e.g. includenamespaceprefixes="xforms 
xf xsd", then the namespaces added to those declared on the root element 
is the set of inherited namespaces that are *visibly utilized* plus those 
listed prefixes (if they do indeed exist as defined namespace prefixes).

The term *visibly utilized* was borrowed from exclusive canonicalization 
and refers to the namespace prefix being used in an element or attribute 
declaration.

A namespace prefix may also be used in an attribute value or other 
content.  In this case, the prefix is not visibly utilized in the XML 
sense but is still needed in order for the submitted instance data to be 
reasonably interpreted.  Indeed we added includenamespaceprefixes as an 
attempt to address this problem.

As we continue to write more mature products that interact with 
XForms-produced data, we're seeing some gaps here.  An important case in 
point is the xsi:type attribute.  It may contain a value like 
"xforms:date", but the prefix xforms is not visibly utilized, and so the 
submission data does not have the prefix if one has used 
includenamespaceprefixes="".  This makes the data unusable by schema 
validating server-side modules.

In this case, we could make authors fix the problem by setting 
includenamespaceprefixes="xf xforms xsd" or some such, but making the form 
author fix the problem is a bandage solution that will become less tenable 
over time as we go further into componentization.

In the long run, it would be better to have our own definition of "visibly 
utilizing" an XML namespace that accommodates any QName datatype 
assignments. For example, xsi:type is defined as a QName in the XML schema 
schema.   Generally, if the datatype of a node is QName, either from a 
type MIP or an available schema, then the XForms submission should look at 
the value of that node for additional namespace prefixes that may be in 
use.

We could even adopt a cheeky name for our new concept, such as "visibly 
using" the namespace, since after all you should use utilize when you can 
reasonably utilize use.

Cheers,
John M. Boyer, Ph.D.
STSM, Interactive Documents and Web 2.0 Applications
Chair, W3C Forms Working Group
Workplace, Portal and Collaboration Software
IBM Victoria Software Lab
E-Mail: boyerj@ca.ibm.com 

Blog: http://www.ibm.com/developerworks/blogs/page/JohnBoyer
Blog RSS feed: 
http://www.ibm.com/developerworks/blogs/rss/JohnBoyer?flavor=rssdw

Received on Tuesday, 24 November 2009 00:41:45 UTC