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>

All,

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:

   current()

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.

   days-to-date()
   seconds-to-dateTime()

Funny Functions
---------------

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

   count-non-empty()
   boolean-from-string()

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:

   xs:boolean()

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

Misc
----

Bunch of useful functions:

   is-card-number()
   power()
   random()
   digest()
   hmac()

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:

     http://www.exslt.org/math/index.html

So what's left after my heavy pruning:

   XPath 2.0 functions
   Subset of EXSLT math functions
   current()
   digest()
   hmac()
   is-card-number()

Food for thoughts.

-Erik

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
http://www.orbeon.com/
Received on Wednesday, 6 August 2008 23:13:58 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 October 2013 22:06:48 UTC