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 7074665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:05:07+00:00 2026-05-28T06:05:07+00:00

Is there any XForms object which I could use to override default evaluation context

  • 0

Is there any XForms object which I could use to override default evaluation context inside an action object? We have xforms:group in body part but do we have any in xforms:action? It would simplify code where I often use the same Nodeset as a base element I’m operating on

I would like to receive such code:

<xf:action ev:event="DOMActivate">
  <?xf:context? ref="instance('main')/d:Content/d:Attachment[index('repeat-id')]"> <!-- ?? -->
    <xf:setvalue ref="d:FileName" value="..." />
    <xf:setvalue ref="d:Description" value="..." />
    <xf:setvalue ref="d:MimeType" value="..." />
    <xf:setvalue ref="d:Size" value="..." />
    <xf:setvalue ref="d:Location" value="..." />
  </?xf:context?>
</xf:action>

so I wouldn’t have to repeat the whole path all over again.

  • 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-28T06:05:08+00:00Added an answer on May 28, 2026 at 6:05 am

    The attribute you are looking for is context. As of XForms 1.1, the context attribute is only available officially on the insert and delete actions, but some implementations already support it on all actions, and it is scheduled for inclusion in XForms 2.

    <xf:action ev:event="DOMActivate" context="instance('main')/d:Content/d:Attachment[index('repeat-id')]">
        <xf:setvalue ref="d:FileName" value="..." />
        <xf:setvalue ref="d:Description" value="..." />
        <xf:setvalue ref="d:MimeType" value="..." />
        <xf:setvalue ref="d:Size" value="..." />
        <xf:setvalue ref="d:Location" value="..." />
    </xf:action>
    

    Note that ref is, as far as I know, not officially allowed on action.

    There is a difference between ref and context as planned for the upcoming XForms 2:

    • context only changes the XPath evaluation context
    • ref usually has other effects, such as binding a control, or specifying the destination of a value (setvalue), etc.

    In XForms 1.1, context on insert unfortunately also can indicate the insertion point, but XForms 2 plans to improve on that and deprecate that use of context.

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

Sidebar

Related Questions

Is there any query which can return me the number of revisions made to
Is there any reason not to use the bitwise operators &, |, and ^
Is there any way to send object / image content type created by Flotr
Is there any function preserved to extract database configuration inside of my code, something
are there any good books/tutorials decscribing how to use CURL library under C++ to
There is any solution to add namespaces without prefix(i mean these ns0, ns1) which
Is there any way, to change the field's *min_length* argument inside form constructor? That
Is there any way I can get NHibernate to use the READPAST hint when
Are there any quick way to map some IDataReader to object without third party
Are there any out of the box solutions to have conditional formatting of HTML

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.