W3C home > Mailing lists > Public > public-forms@w3.org > August 2008

Re: Action 2008-08-6.3: Leigh Klotz to propose a breakdown ofXForms1.2 xpathFunctions into multiple modules today

From: Erik Bruchez <ebruchez@orbeon.com>
Date: Wed, 6 Aug 2008 16:13:14 -0700
Message-Id: <5F9DF16C-62BA-401E-806F-21A41191FA21@orbeon.com>
To: "public-forms (new)" <public-forms@w3.org>


Looks reasonable. random() could arguably be placed into the "Math  
Functions" category.

FWIW, here are my thoughts about what remains in an XPath 2.0 world  
(answer: not much).

Core Functions

This one is clearly important for XForms processing:


Date and Time Functions

Maybe, possibly keep these two, but it's certainly possible to do the  
same with XPath 2.0 functions. I would deprecate them.


Funny Functions

I am not convinced that we need the following functions. I have never  
used them. I would deprecate them.


count-non-empty() can be written as follows in XPath:

   count(nodes[string() != ''])

For boolean-from-string(), in case the value is known to be a boolean  
("true", "false", "1", "0"), you can use the constructor for the  
xs:boolean datatype:


(which is different from the XPath 1.0 boolean() function.)


Bunch of useful functions:


I would like to point out that we don't have a math library. We have  
power() and random(), but nothing else. For a more complete existing  
(and implemented in XSLT processors) math library, see:


So what's left after my heavy pruning:

   XPath 2.0 functions
   Subset of EXSLT math functions

Food for thoughts.


On Aug 6, 2008, at 10:06 AM, Leigh L. Klotz, Jr. wrote:

> Here is my proposed breakdown:
>    E-Commerce Functions
>        is-card-number()
>    Math Functions
>        avg()
>        min()
>        max()
>        power()
>    Data Integrity Functions
>        digest()
>        hmac()
>        random()
>    Date and Time Functions
>        local-date()
>        local-dateTime()
>        now()
>        days-from-date()
>        days-to-date()
>        seconds-from-dateTime()
>        seconds-to-dateTime()
>        adjust-dateTime-to-timezone()
>        seconds()
>        months()
>    Node-set Functions
>        count-non-empty()
>        current()
>    Conditional Functions
>        if()
>        choose()
>        compare()
>        boolean-from-string()
> is-card-number stands alone, as perhaps it should.  For reference,  
> see http://www.w3.org/TR/2000/WD-xforms-datamodel-20000406/#finance-methods
> We proposed moving those functions from the old XForms Data Model  
> spec (Raggett et. al.) on the basis of W3C member comments that the  
> preponderance of such functions make it look like the proposal was  
> for an e-commerce language.
> I did not pursue the idea of separating out our XPath 1.0 extensions  
> that have XPath 2.0 equivalents (such as compare) or replacements-in- 
> kind (such as if), but I feel that we should mark those in some way  
> in the eventual recommendation text.
> Leigh.

Orbeon Forms - Web Forms for the Enterprise Done the Right Way
Received on Wednesday, 6 August 2008 23:13:58 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:48:31 UTC