bind new variable

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

bind new variable

Mohammad
How can I if I want to bind a new variable through API after I got XML by service?
<xf:repeat nodeset="1 to xs:integer($coun)">
     <xxf:variable name="position" select="position()"/>

     <fr:feature ref="$nodes($position)"/>

     this node has two other nodes (name, value) and we need to bind name as an variable
</xf:repeat>
Reply | Threaded
Open this post in threaded view
|

Re: bind new variable

Alessandro  Vernet
Administrator
Hi Mohammad,

So I can more accuratly answer your question, are you writing XForms "by hand", or are you creating a form with Form Builder? If the former, I imagine that you have an <xf:submission> to call the service, correct?

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: bind new variable

Mohammad
This post was updated on .
Hi Alessandro
I create datatabe and got xml data via xf:submission as async.
My problem is binding nodes to variables and saxon:evaluate recognizes name of variables.
Reply | Threaded
Open this post in threaded view
|

Re: bind new variable

Alessandro  Vernet
Administrator
Hi Mohammad,

Are you saying that you'd like a variable defined outside the saxon:evaluate() to be accessible by the expression you pass to saxon:evaluate()? That doesn't seem to be how the function is defined, and the Saxon documentation says: "It does not include any variables from the calling environment." However, you can bind `$p1`, `$p2`… when you call that function. See:

http://www.saxonica.com/html/documentation/functions/saxon/evaluate.html

Does this help?

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: bind new variable

Mohammad
This post was updated on .
Thanks Alessandro
I read document at saxon and help me to understand your tip since I don't know sequence of names at expression so I can pass values to saxon:evaluate.

I have some nodes contain name and value pairs and need to evaluate them. I find evaluateAsString method at org.orbeon.oxf.util.XPath but I have any idea for binding dynamic node to xf:model.
I wish you can imagine my problem.
Reply | Threaded
Open this post in threaded view
|

Re: bind new variable

Alessandro  Vernet
Administrator
Mohammad, I think I'm missing some context here. It seems you are evaluating XPath code from Java code. Is that right? What is the reason? Typically, with Orbeon Forms, there is no need to write Java code. And why do you need to reference variables? Are you the one declaring those variables? If not, where do they come from?

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: bind new variable

Mohammad
This post was updated on .
Sorry Alessandro
Problem is evaluating an expression for controls that represented but those have any anchor.
Again expression must be evaluated for some controls at submit of control via Java or something else and we can not assign xf:bind for them outside of xf:model.
Can I do it with XML Pipeline Language (XPL)? and how?
Reply | Threaded
Open this post in threaded view
|

Re: bind new variable

Alessandro  Vernet
Administrator
Mohammad, I am getting even fuzzier image of what you're trying to do. Could you maybe create a simple example, that I can run here, and that illustrates what you're trying to do?

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet