Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7516409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:07:19+00:00 2026-05-30T01:07:19+00:00

I am looking for a possibility to perform complex calculations for a binding. The

  • 0

I am looking for a possibility to perform complex calculations for a binding. The following instance is given:

<root>
  <appointments>
    <appointment><date>2012-01-01</date></appointment>
    <appointment><date>2012-01-03</date></appointment>
  </appointments>
  <weeks />
</root>

The weeks node depends on the appointment nodes:

$weeks = 0
$week_begin = xs:date("1970-01-01")
for $appointment in //appointments/appoinment
  if # Check if $appointment is in new week
    $weeks = $weeks + 1
    $week_begin = # Do some more calculationx

My problem is that I don’t know where to “put” those calculations. As you can see we need a loop with variables that can store some information between loop cycles. Therefore, I have evaluated the following options:

  1. xforms:variable in combination with xforms:repeat => xforms:variable inside a repeat can’t write to the “outside” scope
  2. xforms:setvalue in combination with an extra instance that holds temporary variables and xforms:repeat
  3. xforms:bind with calculate attribute => for loops in xpath are possible, but no variables

Any advice how to approach this problem? Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T01:07:21+00:00Added an answer on May 30, 2026 at 1:07 am

    You could try to implement the calculation in Javascript that’s triggered if the appointments nodeset has changed. If you’re using Orbeon Forms, you could use the xxforms:script extension. The Orbeon wiki has an example how to set an instance value based on a javascript calculation.

    Another solution would be to completely “externalise” the calculation and to create a little web service (XQuery?) that would return the result of the calculation. You could use the xforms:submit mechanism to feed that service and access its result.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for a possibility to get the color of a pixel with given
I'm looking for possibility to define following options for Sharepoint list. I know it
I am looking for XML/XHTML Java library/framework that can perform the following two tasks
I was looking into the possibility of using CouchDB. I heard that it was
I'm looking at the possibility of generating Java byte code at run time (hopefully
I'm currently looking for a possibility in Java to identify a font as symbolic
I've been looking at the possibility of ReHosting a WF4 Workflow to be used
Looking for C# class which wraps calls to do the following: read and write
Looking into possibility of making an USB distributed application that will autostart on insertion
I'm looking at the possibility of using the tool SQLMetal . I was wondering

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.