1. What is the problem? Be very detailed.
Hello,
I did not find the syntax to combine severals filters to create a variable list,
is it possible to apply severals filters in a same time, for example
instance('ChoiceObs')/root/item[selected(current()/../../q1 , filter)]
or (+ condition)
instance('ChoiceObs')/root/item[filter = 1]
a more complex question,
in the example form below,
if the two choices of the Q1 selection are armed
<item><label>Flavescence</label><value>FLAV</value></item>
<item><label>Xylella</label><value>XYL</value></item>
is it possible to find in the second select
this three item because the value of "filter" contains the value of a response of Q1
<item><filter>FLAV</filter><label>Add observation Flavescence case 1</label><value>Flavescence1</value></item>
<item><filter>FLAV XYL</filter><label>Add observation Flavescence case 2</label><value>Flavescence2</value></item>
<item><filter>XYL</filter><label>Add observation Xylella</label><value>Xylella</value></item>
"Selected" work if "filter" is strictly the same as a value of an item Q1
"Contains" work, but if we arm two choice in Q1, the value is a string of the concatanation of both, so contains can't be use
This in order to share a large list without having to repeat it for each case.
...
<instance id="ChoiceObs">
<root>
<item>
<filter>XYL</filter>
<label>Add observation Xylella</label>
<value>Xylella</value>
</item>
<item>
<filter>FLAV</filter>
<label>Add observation Flavescence case 1</label>
<value>Flavescence1</value>
</item>
<item>
<filter>FLAV XYL</filter>
<label>Add observation Flavescence case 2</label>
<value>Flavescence2</value>
</item>
<item>
<filter>1</filter>
<label>Nothing to observe</label>
<value>RIENAOBS</value>
</item>
</root>
</instance>
...
<select1 ref="/data/repeat_parcelle/repeat_observation/q2">
<label>Add an observation ?</label>
<!-- <itemset nodeset="instance('ChoiceObs')/root/item[selected(current()/../../q1 , filter)]"> -->
<!-- <itemset nodeset="instance('ChoiceObs')/root/item[filter = /data/repeat_parcelle/q1]"> -->
<itemset nodeset="instance('ChoiceObs')/root/item[contains(/data/repeat_parcelle/q1, filter)]">
<value ref="value"/>
<label ref="label"/>
</itemset>
</select1>
...
the example form :
04testForm.xml (2.9 KB)
5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.
I directly create my forms in xml in my notepad.
If you have examples of forms xls or xml that deal with complex cases of Cascading selects with Filtering multiple-choice option lists, I would love to read them to learn the syntax used.
Thanks