submission and XML

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

submission and XML

Bryan
if I have an instance (my actual instance is much more complicated that this example):

<xforms:instance id="my-instance">
    <foo><bar>some data</bar></foo>
</xforms:instance>

How do i submit that data to my spring controller so that it would reload the page and i should be able to get the xml instance via request.getParameter?

I tried all combination of attributes in the xforms:submission and the closest i got was this:

<xforms:submission id="my-submission"                      
                       action="/xforms/mycontroller.gs?data={instance('my-instance')}"
                       method="post" replace="all"/>

when i do request.getParameter('data') in my controller,  i get some data but not in XML form.

Reply | Threaded
Open this post in threaded view
|

Re: submission and XML

Alessandro  Vernet
Administrator
Bryan,

Instead of {instance('my-instance')}, use
{saxon:serialize(instance('my-instance'), 'xml')} to pass the instance
as a request parameter. But I would recommend against it. You are
better off POSTing the instance, and retrieving it from the body of
the POST in your Java code. Using dom4j, it is as simple as:

Document queryDocument = xmlReader.read(request.getInputStream());

Alex

On Wed, Mar 3, 2010 at 1:00 PM, Bryan <[hidden email]> wrote:

>
> if I have an instance (my actual instance is much more complicated that this
> example):
>
> <xforms:instance id="my-instance">
>     some data
> </xforms:instance>
>
> How do i submit that data to my spring controller so that it would reload
> the page and i should be able to get the xml instance via
> request.getParameter?
>
> I tried all combination of attributes in the xforms:submission and the
> closest i got was this:
>
> <xforms:submission id="my-submission"
>
> action="/xforms/mycontroller.gs?data={instance('my-instance')}"
>                       method="post" replace="all"/>
>
> when i do request.getParameter('data') in my controller,  i get some data
> but not in XML form.
>
>
> --
> View this message in context: http://n4.nabble.com/submission-and-XML-tp1577228p1577228.html
> Sent from the Orbeon Forms (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, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet


--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet