repeat set output calculation

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

repeat set output calculation

jparker
Hello,

I am unsure of the best effective way to output a calculation based on values within a repeat set. Can anyone point me in the correct direction?

I have a schema with two values:

  <my-schema>
      <repeating-values>
           <value-a/>
           <value-b/>
      </repeating-values>
  </my-schema>

In the form I want to display a calculation (addition) of value-a and value-b for each repeating set of them.

I cannot change the schema to add a third item into the schema to hold the total.

I assume I need to use a bind, but without an available tag to hold the total value for each item, I'm not sure how to do this. Would I need to create a separate instance that binds a calculate tag for each repeating-values set? I.e.

    <xf:instance id="repeatSet-calculations">
        <repeating-calculations>
             <calculated-value/>
        </repeating-calculations>
    </xf:instance>

If this is the right direction does anyone have an example of how to write the bind statement correctly, and how to reference the calculation within the form repeat set for display (i.e. based on the current index)?

I've not been able to google a clear answer to this. The examples all show a tag within the schema for each repeat set that holds the calculated value. I'm thinking/hoping the answer is pretty straight forward. Hopefully someone can quickly point me to it!

TIA!

-jason
Jason Parker
Reply | Threaded
Open this post in threaded view
|

Re: repeat set output calculation

jparker
Alternatively (although not as flexible a solution) in my case my calculation is simple and if I could use the xpath function numeric-add() I would be able to do it right in the repeat set without the use of a bind.

However, I can't find any reference of support for these operator functions in Orbeon, or the correct namespace reference to use for that matter.

See: http://www.w3.org/TR/xpath-functions/#numeric-functions
(at the top of this page namespaces are listed by strangely none for the op: namespace)

and: http://edocs.bea.com/wli/docs92/xref/xqnsconv.html
(this page lists an op: namespace)

Reply | Threaded
Open this post in threaded view
|

Re: Re: re peat set output calculation

Erik Bruchez
Administrator
As per the documents you point to:

"These functions are not available directly to users, and there is no  
requirement that implementations should actually provide these  
functions. For this reason, no namespace is associated with the op  
prefix."

Just use the operator "+".

-Erik

On Jun 9, 2009, at 8:14 AM, jparker wrote:

>
> Alternatively (although not as flexible a solution) in my case my  
> calculation
> is simple and if I could use the xpath function numeric-add() I  
> would be
> able to do it right in the repeat set without the use of a bind.
>
> However, I can't find any reference of support for these operator  
> functions
> in Orbeon, or the correct namespace reference to use for that matter.
>
> See: http://www.w3.org/TR/xpath-functions/#numeric-functions
> (at the top of this page namespaces are listed by strangely none for  
> the op:
> namespace)
>
> and: http://edocs.bea.com/wli/docs92/xref/xqnsconv.html
> (this page lists an op: namespace)
>
>
> --
> View this message in context: http://www.nabble.com/repeat-set-output-calculation-tp23927310p23944910.html
> Sent from the ObjectWeb OPS - Users mailing list archive at  
> Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email]  
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws