Last call comment: XForms 1.1 is missing a string compare capability

1.1 has a requirement to allow search for data by a key value.  Although 
the detail text doesn't strictly mention it, I expected that our addition 
of the while attribute to XForms actions allowed us to do a search of 
where to put a new piece of data, and the required improvments to insert 
then allowed us to put it there.

We can do this if the "key" is a number, but due to a limitation of XPath 
that I think we did not really note until recently, we cannot do the same 
if the key data is a string such as a name.  This means it is not possible 
for an XForm to maintain the ordered nature of a list of data under insert 

This is a trivially obvious use case that I *thought* we were accounting 
for, and it is easily solved by adding a string-compare() function to the 
XForms function library for XPath, and it should be easy to define it to 
be compatible with string comparison available in XPath 2.0.

Some have complained that since XPath 2 has this, then the right answer is 
to adopt XPath 2.  In principle and in an ideal world, sure we'd get right 
on that, but we should not leave such a gaping hole in XForms 1.1, which 
is still based on XPath 1.0.  Since XPath 1.0 already contains the desired 
feature (the extensibility to allow us to define the function we need), 
there should be nothing wrong with using that feature, esp. if we define a 
compatible function for later upward mobility.  The argument that we 
shouldn't use the XPath 1.0 feature of extensibility because XPath 2 has 
this piece of overlapping functionality is problematic because the 
following conclusion is that we should not add anything since it might 
conflict with XPath 3.0.  If you think this can't happen, observe that it 
already has-- the if() function we desperately needed now conflicts with 
XPath 2.0.

Conclusion: Please solve the problem that we can only maintain ordered 
numeric data and not ordered string data by adding a simple 
string-compare() function.

John M. Boyer, Ph.D.
STSM: Workplace Forms Architect and Researcher
Co-Chair, W3C Forms Working Group
Workplace, Portal and Collaboration Software
IBM Victoria Software Lab


Received on Friday, 9 March 2007 21:48:15 UTC