XPath evaluation : cannot handle function 'floor'

Hello all,

When I want to convert my XLSForm using the application, I get the following error:

Error: ODK Validate Errors: org.javarosa.core.log.WrappedException: Error evaluating field 'femmebureauscore': The problem was located in calculate expression for ${femmebureauscore} XPath evaluation: cannot handle function 'floor' => org.javarosa.xpath.XPathUnhandledException[The problem was located in calculate expression for ${femmebureauscore} XPath evaluation: cannot handle function 'floor']

This comes from the line, in my xls file:
type name label calculation
calculate femmebureauscore score femmes floor(((${Nbres_Membre_bureau_Femmes}div(${Nbres_Membre_bureau_Femmes}+${Nbres_Membre_bureau_Hommes}))+0.18)*4.5)-1

This calculation aims to give à 0 to 4 marks depending on the % of women members in a team.
Nbres_Membre_bureau_Femmes is an integer with the number of women in the team,
Nbres_Membre_bureau_Hommes is an integer with the number of men in the team.

I want a '0' score if there's 0% women, '1' for 30%, '2' for 50%, '3' for 75% and '4' for 100%.

Thus using the formula with floor as XPath function (http://www.w3schools.com/xpath/xpath_functions.asp) should work!

Any idea why it is not working?
Any help?

That would be because floor() is not implemented. The available functions
are listed here: http://opendatakit.org/help/form-design/binding/

··· On Wed, Sep 17, 2014 at 2:54 AM, wrote:

Hello all,

When I want to convert my XLSForm using the application, I get the
following error:

Error: ODK Validate Errors: org.javarosa.core.log.WrappedException: Error
evaluating field 'femmebureauscore': The problem was located in calculate
expression for ${femmebureauscore} XPath evaluation: cannot handle function
'floor' => org.javarosa.xpath.XPathUnhandledException[The problem was
located in calculate expression for ${femmebureauscore} XPath evaluation:
cannot handle function 'floor']

This comes from the line, in my xls file:
type name label calculation
calculate femmebureauscore score femmes
floor(((${Nbres_Membre_bureau_Femmes}div(${Nbres_Membre_bureau_Femmes}+${Nbres_Membre_bureau_Hommes}))+0.18)*4.5)-1

This calculation aims to give à 0 to 4 marks depending on the % of women
members in a team.
Nbres_Membre_bureau_Femmes is an integer with the number of women in the
team,
Nbres_Membre_bureau_Hommes is an integer with the number of men in the
team.

I want a '0' score if there's 0% women, '1' for 30%, '2' for 50%, '3' for
75% and '4' for 100%.

Thus using the formula with floor as XPath function (
http://www.w3schools.com/xpath/xpath_functions.asp) should work!

Any idea why it is not working?
Any help?

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Should be easy to add. As always, code contributions welcome.

Yaw

··· -- Need ODK services? http://nafundi.com provides form design, server setup, professional support, and software development for ODK.

On Wed, Sep 17, 2014 at 9:56 AM, Mitch Sundt mitchellsundt@gmail.com wrote:

That would be because floor() is not implemented. The available functions
are listed here: http://opendatakit.org/help/form-design/binding/

On Wed, Sep 17, 2014 at 2:54 AM, yannick.vesters@gmail.com wrote:

Hello all,

When I want to convert my XLSForm using the application, I get the
following error:

Error: ODK Validate Errors: org.javarosa.core.log.WrappedException: Error
evaluating field 'femmebureauscore': The problem was located in calculate
expression for ${femmebureauscore} XPath evaluation: cannot handle function
'floor' => org.javarosa.xpath.XPathUnhandledException[The problem was
located in calculate expression for ${femmebureauscore} XPath evaluation:
cannot handle function 'floor']

This comes from the line, in my xls file:
type name label calculation
calculate femmebureauscore score femmes
floor(((${Nbres_Membre_bureau_Femmes}div(${Nbres_Membre_bureau_Femmes}+${Nbres_Membre_bureau_Hommes}))+0.18)*4.5)-1

This calculation aims to give à 0 to 4 marks depending on the % of women
members in a team.
Nbres_Membre_bureau_Femmes is an integer with the number of women in the
team,
Nbres_Membre_bureau_Hommes is an integer with the number of men in the
team.

I want a '0' score if there's 0% women, '1' for 30%, '2' for 50%, '3' for
75% and '4' for 100%.

Thus using the formula with floor as XPath function
(http://www.w3schools.com/xpath/xpath_functions.asp) should work!

Any idea why it is not working?
Any help?

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.