Thread: Re: [Xsltforms-support] unpredicatble submission behaviour
Brought to you by:
alain-couthures
From: Alain C. <ala...@ag...> - 2012-11-01 12:49:16
|
Hi, Sorry, AVT for XForms submission is not supported in XForms 1.1 and XSLTForms, use resource sub-element instead: http://www.w3.org/TR/xforms11/#submit-resource-elem XPath 2.0 is not supported either, BTW, but there is the choose() function: http://www.w3.org/TR/xforms11/#fn-choose -Alain Le 01/11/2012 13:42, Dan McCreary a écrit : > Hi Immanuel, > > Perhaps you should consider using HTTP POST and creating a save.xq > similar to the one in the Beginner's Guide. The problem with PUT is > that you must make sure that you have write access and this opens up > security concerns. HTTP POST allows you to use the request:get-data() > to get the incoming data file and then do an xmldb:store() > > Here is the submission line: > > <xf:submission id="save" method="post" action="{if ($new='true') then > ('save-new.xq') else ('update.xq')}" instance="my-task" > replace="all"/> > > http://www.danmccreary.com/xrx/beginners-guide/beginners-guide-to-xrx.xhtml#d0e733 > > - Dan > > On Wed, Oct 31, 2012 at 6:06 PM, Immanuel Normann > <imm...@go...> wrote: >> Hi, >> >> I still try to understand how submission put and get works. Exist-db comes >> with the example >> exist/webapp/xforms/hello2.xml (I assume it is known to you?! see >> http://exist-db.org/exist/xforms/hello2.xml). >> >> This example works basically as one expects. In order to learn from it I >> made copy to >> >> /db/my-hello.xml >> >> and changed only two paths in that file to fit to my setting: >> >> <xf:submission id="put-to-db" method="put" replace="none" >> resource="../rest/db/xforms-example-hello2.xml"> >> >> to >> >> <xf:submission id="put-to-db" method="put" replace="none" >> resource="/exist/rest/db/xforms-example-my-hello.xml"> >> >> and >> >> >> <xf:submission id="get-from-db" method="get" replace="instance" >> resource="../rest/db/xforms-example-hello2.xml?_query=/person&_wrap=no"> >> >> to >> <xf:submission id="get-from-db" method="get" replace="instance" >> resource="/exist/rest/db/xforms-example-my-hello.xml?_query=/person&_wrap=no"> >> >> And this is my problem: >> >> Let's say the initial content of /exist/rest/db/xforms-example-my-hello.xml >> is >> >> <person> >> <name>Otto</name> >> </person> >> >> When I go to http://localhost:8080/exist/rest/db/my-hello.xml everything is >> displayed as in the hello2 example. >> >> Now I type in the text: Anna >> and push the button: Safe >> >> This changes /exist/rest/db/xforms-example-my-hello.xml to: >> >> <person> >> <name>Anna</name> >> <name>Otto</name> >> <name/> >> <name/> >> <test/> >> <name/> >> </person> >> >> Actually this is the same effect as in the hello2 example. The first >> question here: why is >> >> <name/> >> <name/> >> <test/> >> <name/> >> >> added? I would expect only a change to >> >> <person> >> <name>Anna</name> >> <name>Otto</name> >> </person> >> >> But even more strange is the effect of the following interaction: >> >> Let's start again with >> >> <person> >> <name>Otto</name> >> </person> >> >> Now I type again the text: Anna >> but push then the button: Refresh from DB >> >> Still the content of xforms-example-my-hello.xml is (as expected): >> >> <person> >> <name>Otto</name> >> </person> >> >> However, when I type again: Anna >> And then push the button: Safe >> >> Then the content of xforms-example-my-hello.xml is: >> >> <exist:result> >> <name>Anna</name> >> </exist:result> >> >> That's not I would expect. Instead I would expect again: >> >> <person> >> <name>Anna</name> >> <name>Otto</name> >> </person> >> >> For me the behaviour of submission is thus rather unpredictable. Or do you >> have an explanation? I would be very happy to learn how this submission >> really works. >> >> Immanuel >> >> >> ------------------------------------------------------------------------------ >> Everyone hates slow websites. So do we. >> Make your web apps faster with AppDynamics >> Download AppDynamics Lite for free today: >> http://p.sf.net/sfu/appdyn_sfd2d_oct >> _______________________________________________ >> Xsltforms-support mailing list >> Xsl...@li... >> https://lists.sourceforge.net/lists/listinfo/xsltforms-support >> > > |
From: peter w. <p....@in...> - 2012-11-07 12:35:54
|
Hello List I have a draft xform with a submission: <xf:submission id="test-submit" method="get" replace="instance" targetref="instance('service-response-instance')" serialization="none" mode="synchronous" mediatype="text/xml"> <xf:resource value="concat('http://{myserver}/some-service.php?u=' ,instance('read-val'))value/u"/> </xf:submission> In Firefox 16 this gives me a submission to http://{myserver}/some-service.php?u=12345 which seems correct but with IE7 it gives me a submission error that I am still trying to diagnose, and on IE8 it gives an error and the submission is http://{myserver}/some-service.php?u=12345&callback=jsoninst Any thoughts/ideas? Cheers Peter ____________________________________________________________ FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family! Visit http://www.inbox.com/photosharing to find out more! |
From: Alain C. <ala...@ag...> - 2012-11-08 06:50:53
|
Hello Peter, The @value content is not a valid XPath expression. Should it be: concat('http://{myserver}/some-service.php?u=' ,instance('read-val')/value/u) ?? Did you try with the @instance attribute instead of @targetref? Because of the cross-domain restriction, XSLTForms tries to use JSONP when the requested domain is different from the domain from which the form came. IE8 comes with a debugger but I don't remember if there is a Network profiler. Did you give it a try? Thank you for your feedbacks! -Alain Le 07/11/2012 13:35, peter winstanley a écrit : > Hello List > > I have a draft xform with a submission: > > <xf:submission id="test-submit" method="get" replace="instance" targetref="instance('service-response-instance')" serialization="none" mode="synchronous" mediatype="text/xml"> > <xf:resource value="concat('http://{myserver}/some-service.php?u=' ,instance('read-val'))value/u"/> > </xf:submission> > > > In Firefox 16 this gives me a submission to http://{myserver}/some-service.php?u=12345 which seems correct > but with IE7 it gives me a submission error that I am still trying to diagnose, and on IE8 it gives an error and the submission is http://{myserver}/some-service.php?u=12345&callback=jsoninst > > Any thoughts/ideas? > > Cheers > > Peter > > ____________________________________________________________ > FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family! > Visit http://www.inbox.com/photosharing to find out more! > > > |