Evaluation context for <bind> expressions

Dear all

my appologies: I have overlooked to forward the following to you from
the XForms Working Group. Thanks to Mikko Honkala who has prepared that
response, blame on me for letting it sit for a diproportionate long
time. We don't know yet how this is going to work out in the spec, but
it should give you an idea how we intend this to be worked out.

Josef

given the instance:

<items>
	<item>
		<price>100</price>
		<units>5</units>
		<total></total>
	</item>
	<item>
		<price>100</price>
		<units>5</units>
		<total></total>
	</item></items>

and bind:

<bind nodeset="/items/item/total" calculate="../price * ../units"/>

The following happens in calculations:

for each node n in nodeset do:
	calculate "../price * ../units" using
		n as the XPath context node
		the 'bind' element as the namespace context

So the effect is the same as having two binds:

<bind ref="/items/item[1]/total" calculate="../price * ../units"/>
<bind ref="/items/item[2]/total" calculate="../price * ../units"/>

Received on Monday, 29 October 2001 06:16:19 UTC