Xforms instance loading with no events?

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

Re: Dynamic Context for Insert

Erik Bruchez
Administrator
Ah, winmail.dat, I see. Got it now.

-Erik

On Nov 19, 2007, at 3:40 PM, Mackinnon, Mark A. wrote:

> Hi, Erik
>
> When I went to that Nabble link, I found a line at the bottom of the  
> page  that says " winmail.dat (19K) Download Attachment <http://www.nabble.com/attachment/13845347/0/winmail.dat 
> > ".  When I downloaded the file and renamed it from winmail.dat to  
> winmail.zip, it contained the 4 files I was trying to send.  After  
> unzipping, you'll have to rename page-flow.xml.txt to remove the .txt.
>
> Does this help?
>
> Mark
>
> ________________________________
>
> From: [hidden email] on behalf of Erik Bruchez
> Sent: Mon 11/19/2007 5:36 PM
> To: [hidden email]
> Subject: Re: [ops-users] Dynamic Context for Insert
>
>
>
> I don't see it, and Nabble doesn't seem to have received the
> attachement either:
>
>   http://www.nabble.com/RE%3A-Dynamic-Context-for-Insert- 
> p13845347.html
>
> -Erik
>
> On Nov 19, 2007, at 12:57 PM, Mackinnon, Mark A. wrote:
>
>> Hi, Erik
>>
>> I got the attachment when I got the ops-users copy of my message.
>> Here it is again with the zip file renamed as .txt without the
>> phrase .zip anywhere in the name.  Please let me know if it comes
>> through this time.
>>
>> Mark
>>
>> ________________________________
>>
>> From: [hidden email] on behalf of Erik Bruchez
>> Sent: Fri 11/16/2007 7:34 PM
>> To: [hidden email]
>> Subject: Re: [ops-users] Dynamic Context for Insert
>>
>>
>>
>> Is it me or the attachment did not make it?
>>
>> -Erik
>>
>> On Nov 16, 2007, at 2:53 PM, Mackinnon, Mark A. wrote:
>>
>>> Hi, Erik et al.
>>>
>>> I've attached a zip file as requested (with a .txt extension added
>>> to fool my - and maybe others' - email filtering).  I'm running on a
>>> TomCat server, so for me, the files live at C:\Program Files\Apache
>>> Software Foundation\Tomcat 5.5\webapps\ops\WEB-INF\resources\apps
>>> \TestCase - you can create a TestCase folder under your RESOURCES/
>>> apps and extract the 4 files there.  I then invoke the form as http://localhost:8080/ops/TestCase/
>>> .
>>>
>>> I can't show the problem in a single XHTML file, since it involves
>>> coordination between multiple pages (unless, of course, you slap me
>>> upside the head and show me a simpler solution <g>).
>>>
>>> Thanks in advance,
>>> Mark
>>>
>>> ________________________________
>>>
>>> From: [hidden email] on behalf of Erik Bruchez
>>> Sent: Fri 11/16/2007 2:30 PM
>>> To: [hidden email]
>>> Subject: Re: [ops-users] Dynamic Context for Insert
>>>
>>>
>>>
>>> Mark,
>>>
>>> Is there any way you could send your files as a self-contained zip  
>>> of
>>> a directory under RESOURCES/apps, with full instructions as to what
>>> URL to hit and what else to do if necessary? This would make it
>>> easier
>>> to run your example. Even better, can you show the problem in a
>>> single
>>> XHTML file that can run in the sandbox?
>>>
>>> The easiest it is for people to get your app to run, the more likely
>>> you are to have an answer ;-)
>>>
>>> -Erik
>>>
>>>>
>>>> Hi, all
>>>>
>>>> I sent this last week and haven't seen a response yet - maybe I
>>>> missed it amongst the ops traffic, or perhaps you all didn't see  
>>>> it?
>>>>
>>>> Anyway, here it is again with my apologies to those who are seeing
>>>> it twice.
>>>>
>>>> Mark
>>>> From: [hidden email] on behalf of Mackinnon, Mark A.
>>>> Sent: Tue 11/6/2007 5:49 PM
>>>> To: [hidden email]
>>>> Subject: RE: [ops-users] Dynamic Context for Insert
>>>>
>>>> Hi, Alex et al.
>>>>
>>>> I've attached some files which I hope will provide a simple example
>>>> of what I'm trying to do.
>>>>
>>>> 1) blank-doc.xml is a template for the instance I'm trying to get
>>>> filled-in.  There's some fields to be filled-in in the main  
>>>> document
>>>> (represented by a single tag <SomeMainData/>) and 3 empty sections
>>>> (A, B, and C).  The <Context> field at the end is for experimental
>>>> purposes (as described below).
>>>>
>>>> 2) page-flow.xml describes 2 pages, one for the main portion of the
>>>> document, and one for a document section.  Note that the main page
>>>> points to blank-doc.xml through the default-submission attribute.
>>>>
>>>> 3) The model in doc-main.xhtml uses xi:include to bring in the
>>>> instance (in this case, blank-doc.xml).  It also has an
>>>> <xforms:input> to solicit text for the <SomeMainData/> field,  
>>>> then 3
>>>> triggers and associated submission elements to jump to the 2nd page
>>>> to fill in one of the 3 sections.
>>>>
>>>> 4) doc-section.xhtml also brings in the instance using xi:include.
>>>> It also has a local template instance for the narrative that will  
>>>> be
>>>> inserted into a section.  There is an <xforms:input> to solicit  
>>>> this
>>>> narrative, then a trigger with an insert and a setvalue to copy  
>>>> this
>>>> narrative to the desired main instance section.
>>>>
>>>> Note that the context attribute on the insert (line 44, doc-
>>>> section.xhtml) is ".".  This seems to correspond to the value of  
>>>> the
>>>> ref attribute ("/") in lines 27-29 of doc-main.xhtml.  As things
>>>> currently stand, any insertions made become children of the DocRoot
>>>> element.  If I change the ref attribute in doc-main to "/DocRoot/
>>>> SectionA", I can get the insertion to go where I want, but when I
>>>> try to return to doc-main to fill-in another section, I can't get
>>>> back to the DocRoot element.
>>>>
>>>> I can leave the ref in the doc-main submission as "/" and hard-code
>>>> the context attribute in doc-section to "/DocRoot/SectionA" rather
>>>> than ".".  Now I can get to doc-section, insert at SectionA and
>>>> return to doc-main with the whole instance accessible, but I'd have
>>>> to have many section pages with hard-coded context attributes, one
>>>> for each section (and there a many more than 3).
>>>>
>>>> I thought I could "pass the context into" the section page somehow.
>>>> At first, I thought I would use setvalue within each of the 3
>>>> triggers in doc-main to change the contents of the <Context> tag
>>>> from "/DocRoot/SectionA" to "/DocRoot/SectionB" etc., then set the
>>>> context attribute in the insert as context="/DocRoot/Context" but,
>>>> of course, alll I got was the string /DocRoot/Context rather than
>>>> the string that is the content of that node, and no insertion took
>>>> place at all.  (Actually, I don't like this technique because, when
>>>> I finally submit the form, I don't want the <Context> tag hanging
>>>> around.  If something like this could work, I'd rather the  
>>>> <Context>
>>>> info was in a separate instance, but I don't know how to pass 2
>>>> instances using the xi:include technique.  But first things first).
>>>>
>>>> Anyway, that's my problem, and I hope I've described it in enough
>>>> detail.  Any suggestions would be greatly appreciated.
>>>>
>>>> Thanks,
>>>> Mark MacKinnon
>>>>
>>>>
>>>> From: [hidden email] on behalf of Alessandro Vernet
>>>> Sent: Mon 11/5/2007 10:00 PM
>>>> To: [hidden email]
>>>> Subject: Re: [ops-users] Dynamic Context for Insert
>>>>
>>>> Mark,
>>>>
>>>> On Nov 5, 2007 5:09 PM, Mackinnon, Mark A.
>>>> <[hidden email]> wrote:
>>>>> Is there a way to get a dynamic insertion point into the page
>>>> (specifically, I think, to be used in the context attribute of the
>>>> xforms:insert tag)?  I've been attempting to set a value into a
>>>> Context tag in my instance and pull that value out in the secondary
>>>> page, but I can't seem to get at the value of the Context tag  
>>>> inside
>>>> the insert (if I say <xforms:insert context="Context" ... I get the
>>>> string "Context", not its value which might be "/MainDoc/Section1",
>>>> "MainDoc/Section2", etc.)  I read some speculation of an
>>>> xforms:variable in past forums, where I might say <xforms:variable
>>>> name="current-context" ref="Context"/> and then say <xforms:insert
>>>> context="$current-context" ... but apparently that has never been
>>>> implemented?
>>>>
>>>> Yes, like you discovered, there is no <xforms:variable> in XForms  
>>>> or
>>>> in Orbeon Forms at this point. Now I don't quite understand the
>>>> issue
>>>> with <xforms:insert context="Context">. You use the context
>>>> attribute
>>>> to set where the data is inserted, so I am not sure what getting  
>>>> the
>>>> string "Context" means in this case. Could you create a simple
>>>> example
>>>> that runs in the XForms sandbox and that shows this issues?
>>>>
>>>> Alex
>>>> --
>>>> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
>>>> http://www.orbeon.com/
>>>>
>>>> <blank-doc.xml.txt><page-flow.xml.txt>
>>>>
>>>> --
>>>> 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/
>>>
>>>
>>>
>>> <winmail.dat>
>>> --
>>> 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/
>>
>>
>>
>> <winmail.dat>
>> --
>> 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/
>
>
>
> <winmail.dat>
> --
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Context for Insert

Erik Bruchez
Administrator
In reply to this post by Mackinnon, Mark A.
Ok I got your example running. Now I assume that what you are trying  
to do is have doc-main.xhtml pass to doc-section.xhtml an XPath  
expression that specifies where the insertion must take place. Is that  
it?

In XForms (and XSLT for that matter), XPath expressions are always  
statically defined. That is, they are present in the source code of  
the XForms or XSLT document and you cannot dynamically build new XPath  
expressions. That is, unless you use an extension function which is  
not part of XForms or XSLT. You are in that case, since the XPath  
expression you want to evaluate is passed to the page.

The good news is that we give you access to the saxon:evaluate()  
function from XForms, which does exactly that. So you can write:

<xf:insert context="saxon:evaluate(Context)" nodeset="Narr"
            origin="instance('narr-template')/Narr" position="after"/>

I attach a modified doc-section.xhtml showing this.

-Erik


On Nov 19, 2007, at 3:40 PM, Mackinnon, Mark A. wrote:

> Hi, Erik
>
> When I went to that Nabble link, I found a line at the bottom of the  
> page  that says " winmail.dat (19K) Download Attachment <http://www.nabble.com/attachment/13845347/0/winmail.dat 
> > ".  When I downloaded the file and renamed it from winmail.dat to  
> winmail.zip, it contained the 4 files I was trying to send.  After  
> unzipping, you'll have to rename page-flow.xml.txt to remove the .txt.
>
> Does this help?
>
> Mark
>
> ________________________________
>
> From: [hidden email] on behalf of Erik Bruchez
> Sent: Mon 11/19/2007 5:36 PM
> To: [hidden email]
> Subject: Re: [ops-users] Dynamic Context for Insert
>
>
>
> I don't see it, and Nabble doesn't seem to have received the
> attachement either:
>
>   http://www.nabble.com/RE%3A-Dynamic-Context-for-Insert- 
> p13845347.html
>
> -Erik
>
> On Nov 19, 2007, at 12:57 PM, Mackinnon, Mark A. wrote:
>
>> Hi, Erik
>>
>> I got the attachment when I got the ops-users copy of my message.
>> Here it is again with the zip file renamed as .txt without the
>> phrase .zip anywhere in the name.  Please let me know if it comes
>> through this time.
>>
>> Mark
>>
>> ________________________________
>>
>> From: [hidden email] on behalf of Erik Bruchez
>> Sent: Fri 11/16/2007 7:34 PM
>> To: [hidden email]
>> Subject: Re: [ops-users] Dynamic Context for Insert
>>
>>
>>
>> Is it me or the attachment did not make it?
>>
>> -Erik
>>
>> On Nov 16, 2007, at 2:53 PM, Mackinnon, Mark A. wrote:
>>
>>> Hi, Erik et al.
>>>
>>> I've attached a zip file as requested (with a .txt extension added
>>> to fool my - and maybe others' - email filtering).  I'm running on a
>>> TomCat server, so for me, the files live at C:\Program Files\Apache
>>> Software Foundation\Tomcat 5.5\webapps\ops\WEB-INF\resources\apps
>>> \TestCase - you can create a TestCase folder under your RESOURCES/
>>> apps and extract the 4 files there.  I then invoke the form as http://localhost:8080/ops/TestCase/
>>> .
>>>
>>> I can't show the problem in a single XHTML file, since it involves
>>> coordination between multiple pages (unless, of course, you slap me
>>> upside the head and show me a simpler solution <g>).
>>>
>>> Thanks in advance,
>>> Mark
>>>
>>> ________________________________
>>>
>>> From: [hidden email] on behalf of Erik Bruchez
>>> Sent: Fri 11/16/2007 2:30 PM
>>> To: [hidden email]
>>> Subject: Re: [ops-users] Dynamic Context for Insert
>>>
>>>
>>>
>>> Mark,
>>>
>>> Is there any way you could send your files as a self-contained zip  
>>> of
>>> a directory under RESOURCES/apps, with full instructions as to what
>>> URL to hit and what else to do if necessary? This would make it
>>> easier
>>> to run your example. Even better, can you show the problem in a
>>> single
>>> XHTML file that can run in the sandbox?
>>>
>>> The easiest it is for people to get your app to run, the more likely
>>> you are to have an answer ;-)
>>>
>>> -Erik
>>>
>>>>
>>>> Hi, all
>>>>
>>>> I sent this last week and haven't seen a response yet - maybe I
>>>> missed it amongst the ops traffic, or perhaps you all didn't see  
>>>> it?
>>>>
>>>> Anyway, here it is again with my apologies to those who are seeing
>>>> it twice.
>>>>
>>>> Mark
>>>> From: [hidden email] on behalf of Mackinnon, Mark A.
>>>> Sent: Tue 11/6/2007 5:49 PM
>>>> To: [hidden email]
>>>> Subject: RE: [ops-users] Dynamic Context for Insert
>>>>
>>>> Hi, Alex et al.
>>>>
>>>> I've attached some files which I hope will provide a simple example
>>>> of what I'm trying to do.
>>>>
>>>> 1) blank-doc.xml is a template for the instance I'm trying to get
>>>> filled-in.  There's some fields to be filled-in in the main  
>>>> document
>>>> (represented by a single tag <SomeMainData/>) and 3 empty sections
>>>> (A, B, and C).  The <Context> field at the end is for experimental
>>>> purposes (as described below).
>>>>
>>>> 2) page-flow.xml describes 2 pages, one for the main portion of the
>>>> document, and one for a document section.  Note that the main page
>>>> points to blank-doc.xml through the default-submission attribute.
>>>>
>>>> 3) The model in doc-main.xhtml uses xi:include to bring in the
>>>> instance (in this case, blank-doc.xml).  It also has an
>>>> <xforms:input> to solicit text for the <SomeMainData/> field,  
>>>> then 3
>>>> triggers and associated submission elements to jump to the 2nd page
>>>> to fill in one of the 3 sections.
>>>>
>>>> 4) doc-section.xhtml also brings in the instance using xi:include.
>>>> It also has a local template instance for the narrative that will  
>>>> be
>>>> inserted into a section.  There is an <xforms:input> to solicit  
>>>> this
>>>> narrative, then a trigger with an insert and a setvalue to copy  
>>>> this
>>>> narrative to the desired main instance section.
>>>>
>>>> Note that the context attribute on the insert (line 44, doc-
>>>> section.xhtml) is ".".  This seems to correspond to the value of  
>>>> the
>>>> ref attribute ("/") in lines 27-29 of doc-main.xhtml.  As things
>>>> currently stand, any insertions made become children of the DocRoot
>>>> element.  If I change the ref attribute in doc-main to "/DocRoot/
>>>> SectionA", I can get the insertion to go where I want, but when I
>>>> try to return to doc-main to fill-in another section, I can't get
>>>> back to the DocRoot element.
>>>>
>>>> I can leave the ref in the doc-main submission as "/" and hard-code
>>>> the context attribute in doc-section to "/DocRoot/SectionA" rather
>>>> than ".".  Now I can get to doc-section, insert at SectionA and
>>>> return to doc-main with the whole instance accessible, but I'd have
>>>> to have many section pages with hard-coded context attributes, one
>>>> for each section (and there a many more than 3).
>>>>
>>>> I thought I could "pass the context into" the section page somehow.
>>>> At first, I thought I would use setvalue within each of the 3
>>>> triggers in doc-main to change the contents of the <Context> tag
>>>> from "/DocRoot/SectionA" to "/DocRoot/SectionB" etc., then set the
>>>> context attribute in the insert as context="/DocRoot/Context" but,
>>>> of course, alll I got was the string /DocRoot/Context rather than
>>>> the string that is the content of that node, and no insertion took
>>>> place at all.  (Actually, I don't like this technique because, when
>>>> I finally submit the form, I don't want the <Context> tag hanging
>>>> around.  If something like this could work, I'd rather the  
>>>> <Context>
>>>> info was in a separate instance, but I don't know how to pass 2
>>>> instances using the xi:include technique.  But first things first).
>>>>
>>>> Anyway, that's my problem, and I hope I've described it in enough
>>>> detail.  Any suggestions would be greatly appreciated.
>>>>
>>>> Thanks,
>>>> Mark MacKinnon
>>>>
>>>>
>>>> From: [hidden email] on behalf of Alessandro Vernet
>>>> Sent: Mon 11/5/2007 10:00 PM
>>>> To: [hidden email]
>>>> Subject: Re: [ops-users] Dynamic Context for Insert
>>>>
>>>> Mark,
>>>>
>>>> On Nov 5, 2007 5:09 PM, Mackinnon, Mark A.
>>>> <[hidden email]> wrote:
>>>>> Is there a way to get a dynamic insertion point into the page
>>>> (specifically, I think, to be used in the context attribute of the
>>>> xforms:insert tag)?  I've been attempting to set a value into a
>>>> Context tag in my instance and pull that value out in the secondary
>>>> page, but I can't seem to get at the value of the Context tag  
>>>> inside
>>>> the insert (if I say <xforms:insert context="Context" ... I get the
>>>> string "Context", not its value which might be "/MainDoc/Section1",
>>>> "MainDoc/Section2", etc.)  I read some speculation of an
>>>> xforms:variable in past forums, where I might say <xforms:variable
>>>> name="current-context" ref="Context"/> and then say <xforms:insert
>>>> context="$current-context" ... but apparently that has never been
>>>> implemented?
>>>>
>>>> Yes, like you discovered, there is no <xforms:variable> in XForms  
>>>> or
>>>> in Orbeon Forms at this point. Now I don't quite understand the
>>>> issue
>>>> with <xforms:insert context="Context">. You use the context
>>>> attribute
>>>> to set where the data is inserted, so I am not sure what getting  
>>>> the
>>>> string "Context" means in this case. Could you create a simple
>>>> example
>>>> that runs in the XForms sandbox and that shows this issues?
>>>>
>>>> Alex
>>>> --
>>>> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
>>>> http://www.orbeon.com/
>>>>
>>>> <blank-doc.xml.txt><page-flow.xml.txt>
>>>>
>>>> --
>>>> 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/
>>>
>>>
>>>
>>> <winmail.dat>
>>> --
>>> 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/
>>
>>
>>
>> <winmail.dat>
>> --
>> 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/
>
>
>
> <winmail.dat>
> --
> 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

doc-section.xhtml (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Dynamic Context for Insert

Mackinnon, Mark A.
Hi, Erik
 
Thanks for the response.  I took the doc-section.xhtml you sent that uses saxon:evaluate(Context), modified my doc-main.xhtml to change the value of Context depending on which section I wish to fill in (A, B, or C) and everything works fine.
 
Now, I wish to "improve" the technique.  I'd really like to have Context in a separate instance.  For one thing, I don't want to submit the Context tag with the form, which I guess I could prevent with relevancy or something.  The bigger issue is, my instance wants to reference an external XML-schema for validation and data typing purposes, and Context would not be defined in that schema.  I could put Context in a separate instance, but then how do I pass 2 instances between pages?  Or is there some other way to do this?
 
Thanks,
Mark
 
P.S.  I'll be traveling for the next week so I may be slow acknowledging any responses you may send.

________________________________

From: [hidden email] on behalf of Erik Bruchez
Sent: Tue 11/20/2007 5:29 PM
To: [hidden email]
Subject: Re: [ops-users] Dynamic Context for Insert



Ok I got your example running. Now I assume that what you are trying
to do is have doc-main.xhtml pass to doc-section.xhtml an XPath
expression that specifies where the insertion must take place. Is that
it?

In XForms (and XSLT for that matter), XPath expressions are always
statically defined. That is, they are present in the source code of
the XForms or XSLT document and you cannot dynamically build new XPath
expressions. That is, unless you use an extension function which is
not part of XForms or XSLT. You are in that case, since the XPath
expression you want to evaluate is passed to the page.

The good news is that we give you access to the saxon:evaluate()
function from XForms, which does exactly that. So you can write:

<xf:insert context="saxon:evaluate(Context)" nodeset="Narr"
            origin="instance('narr-template')/Narr" position="after"/>

I attach a modified doc-section.xhtml showing this.

-Erik




--
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

winmail.dat (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Context for Insert

Erik Bruchez
Administrator
Mark,

> Thanks for the response.  I took the doc-section.xhtml you sent that  
> uses saxon:evaluate(Context), modified my doc-main.xhtml to change  
> the value of Context depending on which section I wish to fill in  
> (A, B, or C) and everything works fine.

Great to hear that!

> Now, I wish to "improve" the technique.  I'd really like to have  
> Context in a separate instance.  For one thing, I don't want to  
> submit the Context tag with the form, which I guess I could prevent  
> with relevancy or something.  The bigger issue is, my instance wants  
> to reference an external XML-schema for validation and data typing  
> purposes, and Context would not be defined in that schema.  I could  
> put Context in a separate instance, but then how do I pass 2  
> instances between pages?  Or is there some other way to do this?


In theory, one can imagine submitting a multipart document containing  
several instances, but this is not a feature of XForms or Orbeon Forms  
yet.

So you have to use a workaround. You could assemble and disassemble  
instances when submitting them, e.g.:

* Page 1, upon xforms-submit:
** Insert the two instances to submit into a separate submission  
instance
** Submit that combined instance
* Page 2, upon xforms-ready:
** Receive combined instance
** Insert the two sub-instances into two separate instances

If you only have a few parameters to pass, you could pass them as URL  
parameters. This is easy to do from the submitting page. On the  
receiving page, it's a little trickier (but still doable) to access  
both a URL parameter and a submitted XML instance.

-Erik

--
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
Reply | Threaded
Open this post in threaded view
|

RE: Dynamic Context for Insert

Mackinnon, Mark A.
Thanks, Erik
 
I think the only parameter I have to pass is the insertion context, so I imagine using an URL parameter might be cleaner (clearer? simpler?), but I think I can see how the sub-instance method would work.
 
Could you, at your "leisure", give me a hint on the URL parameter method?  I tried something like that before changing my submissions from POST to GET and adding the context as a query string but, if I recall, the whole instance was appended to the query string, which is definitely not clean.
 
I'll do some research of my own when I get back from travel if you don't have a chance to respond.
 
Thanks, and Happy Thanksgiving to all out there!
 
Mark

________________________________

From: [hidden email] on behalf of Erik Bruchez
Sent: Wed 11/21/2007 3:30 PM
To: [hidden email]
Subject: Re: [ops-users] Dynamic Context for Insert



Mark,

> Thanks for the response.  I took the doc-section.xhtml you sent that
> uses saxon:evaluate(Context), modified my doc-main.xhtml to change
> the value of Context depending on which section I wish to fill in
> (A, B, or C) and everything works fine.

Great to hear that!

> Now, I wish to "improve" the technique.  I'd really like to have
> Context in a separate instance.  For one thing, I don't want to
> submit the Context tag with the form, which I guess I could prevent
> with relevancy or something.  The bigger issue is, my instance wants
> to reference an external XML-schema for validation and data typing
> purposes, and Context would not be defined in that schema.  I could
> put Context in a separate instance, but then how do I pass 2
> instances between pages?  Or is there some other way to do this?


In theory, one can imagine submitting a multipart document containing
several instances, but this is not a feature of XForms or Orbeon Forms
yet.

So you have to use a workaround. You could assemble and disassemble
instances when submitting them, e.g.:

* Page 1, upon xforms-submit:
** Insert the two instances to submit into a separate submission
instance
** Submit that combined instance
* Page 2, upon xforms-ready:
** Receive combined instance
** Insert the two sub-instances into two separate instances

If you only have a few parameters to pass, you could pass them as URL
parameters. This is easy to do from the submitting page. On the
receiving page, it's a little trickier (but still doable) to access
both a URL parameter and a submitted XML instance.

-Erik

--
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

winmail.dat (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Context for Insert

Erik Bruchez
Administrator
Mark,

The first step is to create the submission URL. For this you can use  
AVTs (Attribute Value Templates) to dynamically configure the action:

     <xforms:submission ... action="/my/path/{instance('parameters-
instance')/my-parameter}" .../>

The second part consists in using the oxf:request processor and the  
oxf:perl5-matchers in a pipeline:

     <p:processor name="oxf:request">
         <p:input name="config">
             <config>
                 <include>/request/request-path</include>
             </config>
         </p:input>
         <p:output name="data" id="request"/>
     </p:processor>

     <p:processor name="oxf:perl5-matcher">
         <p:input name="config"><config>/my/path/(.+)</config></p:input>
         <p:input name="data" href="#request#xpointer(/request/request-
path)"/>
         <p:output name="data" id="matcher-groups"/>
     </p:processor>

You will then obtain an XML document of the form:

     <result>
         <group>whatever my-parameter was set to</group>
     </result

-Erik

On Nov 21, 2007, at 1:12 PM, Mackinnon, Mark A. wrote:

> Thanks, Erik
>
> I think the only parameter I have to pass is the insertion context,  
> so I imagine using an URL parameter might be cleaner (clearer?  
> simpler?), but I think I can see how the sub-instance method would  
> work.
>
> Could you, at your "leisure", give me a hint on the URL parameter  
> method?  I tried something like that before changing my submissions  
> from POST to GET and adding the context as a query string but, if I  
> recall, the whole instance was appended to the query string, which  
> is definitely not clean.
>
> I'll do some research of my own when I get back from travel if you  
> don't have a chance to respond.
>
> Thanks, and Happy Thanksgiving to all out there!
>
> Mark
>
> ________________________________
>
> From: [hidden email] on behalf of Erik Bruchez
> Sent: Wed 11/21/2007 3:30 PM
> To: [hidden email]
> Subject: Re: [ops-users] Dynamic Context for Insert
>
>
>
> Mark,
>
>> Thanks for the response.  I took the doc-section.xhtml you sent that
>> uses saxon:evaluate(Context), modified my doc-main.xhtml to change
>> the value of Context depending on which section I wish to fill in
>> (A, B, or C) and everything works fine.
>
> Great to hear that!
>
>> Now, I wish to "improve" the technique.  I'd really like to have
>> Context in a separate instance.  For one thing, I don't want to
>> submit the Context tag with the form, which I guess I could prevent
>> with relevancy or something.  The bigger issue is, my instance wants
>> to reference an external XML-schema for validation and data typing
>> purposes, and Context would not be defined in that schema.  I could
>> put Context in a separate instance, but then how do I pass 2
>> instances between pages?  Or is there some other way to do this?
>
>
> In theory, one can imagine submitting a multipart document containing
> several instances, but this is not a feature of XForms or Orbeon Forms
> yet.
>
> So you have to use a workaround. You could assemble and disassemble
> instances when submitting them, e.g.:
>
> * Page 1, upon xforms-submit:
> ** Insert the two instances to submit into a separate submission
> instance
> ** Submit that combined instance
> * Page 2, upon xforms-ready:
> ** Receive combined instance
> ** Insert the two sub-instances into two separate instances
>
> If you only have a few parameters to pass, you could pass them as URL
> parameters. This is easy to do from the submitting page. On the
> receiving page, it's a little trickier (but still doable) to access
> both a URL parameter and a submitted XML instance.
>
> -Erik
>
> --
> Orbeon Forms - Web Forms for the Enterprise Done the Right Way
> http://www.orbeon.com/
>
>
>
> <winmail.dat>
> --
> 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
12