How to have an OR selection in XML Datasource in Jasper?

21 Views Asked by At

I'm using an XML file as Datasource in Jasper. I can have all the fields I need with no problem but now I will need to use one of many possible results for a field in the XML file.

As an example, I will have:

enter image description here

I want to have a field in the datasource as "my_field", which will be a String and then for the value I will have "group[field1="100" OR field1="200"]/field2".

I'm doing so but I have an expression error. For only one is working well, for 100 or for 200 individually, but if I want to group the expression because both are valid for me, I have this expression error.

Is it possible to do that? Can I group the results? Because even if field2 is not the same for both, I would like to have the value just for one of them.

1

There are 1 best solutions below

0
Cristian López González On

The solution was just using lower case to write the OR:

"group[field1="100" or field1="200"]/field2"

I did not know it was case sensitive.