Hi Leo,
Sorry I misunderstood your issue!
I didn't notice that you were using a repeating grid, apologizes there..
So your issue is with the part
xxf:instance('fr-form-instance')//country]/states/_/state
when you insert another row into your repeating grid this xpath will find
all the matches to this expression, so what you need to do is make sure this
xpath only applies to the current iteration of your repeating grid. We can
use the `xxf:repeat-position()` function to get this!
So your xpath would look something like the following for your State
xxf:instance('fr-dataset-geo')/countries/_[country =
xxf:instance('fr-form-instance')//grid-2-iteration[xxf:repeat-position()]//country]/states/_/state
And for your city
xxf:instance('fr-dataset-geo')/countries/_[country =
xxf:instance('fr-form-instance')//grid-2-iteration[xxf:repeat-position()]/country]/states/_[state
=
xxf:instance('fr-form-instance')//grid-2-iteration[xxf:repeat-position()]/state]/cities/_/city
Hope that helps
Joel.