Validate errors: dependency cycles amongst the xpath expressions

Hi,
I have created an xls form that I want to convert for testing. However, I keep getting this error Error: b'ODK Validate Errors:\n>> Something broke the parser. See above for a hint.\nDependency cycles amongst the xpath expressions in relevant/calculate\n\nResult: Invalid'
I am using version 1.2.0.
Anyone who might know how I can resolve this problem kindly help. It is driving me crazy.

Thanks in advance.

1 Like

Can you please post your form definition. It sounds like you may have a mutually incompatible/logically invalid pair of XPath calculations.

2 Likes

Hi Dr. Gareth.
Thank you for getting back to me.
I have managed to identify where the above mentioned problem. However, another problem cropped up.
When adding up the totals for hh incomes, hh expenditures and total incomes from other sources.

I will post the form definition so that you can have a look at it.

Thank you in advance.

Please see the form definition with the raws in question highlighted in red.
Kind regards.Mothers_questionnaire.xlsx (49.0 KB)

Please share what you identified the problem to be, and how you fixed it, so that perhaps others landing here in the future can determine if they hit the same problem.

If there is now something else wrong in your form, please start a new thread. BTW, a common mistake when making summation calculations - eg your "adding up the totals" - is not handling potentially null/empty operands; see here

1 Like

Your ${totalhhpurchaseann} is a long summation of many other values. If any single one of these is not answered (ie null), then the entire sum will become invalid (NaN)! Unless every operand in your sum is mandatory, you have to explicitly add logic to your calculations to treat empty/null values as 0. Again, please refer to my previous link for details.

1 Like

5 posts were split to a new topic: Dependency cycles amongst the xpath expressions

Hi, Xiphware,
The problem I found was I was adding a "relevant" function in the single select question select_one yn. That was what was breaking the logic path in the form.

I am working on amending the sum function as you have advised in your previous forum post. I will post here how it goes. Thank you for your help. Much appreciated.

Hi! I keep getting this msg:

Error: b'ODK Validate Errors:\n>> Something broke the parser. See above for a hint.\nDependency cycles amongst the xpath expressions in relevant/calculate\n\nResult: Invalid'

Can someone explain why I am getting this result?Baseline_survey_Udaan.xlsx (51.8 KB)

First off, you have typos in a lot of your relevant expressions. eg

selected(${children_anganwadi},'yes') or slected(${children_Udaan_centre},'yes')

Start by fixing all them, and have another go.

Thanks. I realized where i was making the mistake

I need your help

ODK Validate Errors:
Dependency cycles amongst the xpath expressions in relevant/calculate

use ODK XLSForm Offline1.8.exe
Thank you in advance

Household_questionnaire.xlsx (67.8 KB)

I do not get any error. Probably you attached wrong file.

Oi,
eu criei um formulário xls que eu quero converter para teste. No entanto, eu continuo recebendo este

Error: b'ODK Validate Errors:\n>> Something broke the parser. See above for a hint.\nDependency cycles amongst the xpath expressions in relevant/calculate\n\nThe following files failed validation:\n${smart_gb4}.xml\n\nResult: Invalid'

Vou postar a definição do formulário para que você possa dar uma olhada nele.

Agradeço antecipadamente.smart_gb4.xlsx (70.9 KB)

Hi @ocristo
the problem is in relevant column in lines 81 and 83
you can't use an answer from the current question in relevant ${anje05amamnome} = 2 because it doesn't exist yet.
What do you try to achieve? It's in repeat group so probably you want an answer from a previous repat group?

O problema que põe é que queria que quando respondesse essa questão Não=2 que saltasse as questões seguintes até anje09

[quote="ocristo, post:21, topic:14404"]
problema que se põe é que quando respondem nessa questão Não = 2 que saltasse as para anje09