xxforms:variable workaround?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

xxforms:variable workaround?

Mike Ahlers
Hi,

Just realized this is part of the future 3.7 release and not in the stable 3.6...

I think I need it, but is there a work around for the following, without the feature?

Within a repeater, I am referencing a resource lookup from a different instance:

...
<xforms:repeat nodeset="instance('data-instance')/country" id="data-repeat">
...
    <xforms:output value="@id"/>
    ...
    <xforms:output value="xxforms:instance('resource-instance')/countries/country[@iso = ?]"/>
    ...

I cannot do @iso = @id for that evaluates attributes on the same node. Is it possible to construct an xpath expression using the index('data-repeat')? If so, how?

As side-question, what is the difference between exforms:variable and xxforms:variable?

Thanks in advance,
Mike
Reply | Threaded
Open this post in threaded view
|

Re: xxforms:variable workaround?

Mike Ahlers
Small update,

I managed to formulate the xpath expression which I think should work, but doesn't.

<xforms:output value="xxforms:instance('resource-instance')/countries/country[@iso = instance('data-instance')/country[count(preceding-sibling::country) + 1]/@id]"/>

Always gives the same value for all entries.

However, when I do an output of:

<xforms:output value="count(preceding-sibling::country) + 1"/>

I do see increasing numbers.

What can it be?
Mike