Re: [Xsltforms-support] XSLTForms xf:submit issues
Brought to you by:
alain-couthures
From: COUTHURES A. <ala...@ag...> - 2009-11-25 05:47:49
|
Hi Alex, I didn't mention another possibility in my previous response: the cross-domain constraint. Javascript is allowed to ask and send data just to the same domain with the same port. Do you have this problem? Best regards, -Alain > Hi Alain, > > Thanks very much for your response. I checked the latest code from svn and copied the latest files from trunk/build into my project. I tried adding the xmlns="" in beta 2 and in both with and without with the current build in trunk. > > Unfortunately I still seem to be having problems submitting data successfully; I was wondering whether I could just run my latest code by you and see if I can get some advice? > > I'm testing the submissions on MarkLogic 4.1 this time (the target db for this project). As before, I'm having success submitting using Internet Explorer 8; however, for some reason, Chrome and Firefox 3.5 are still throwing errors. I haven't tried Opera since. > > IE8 shows the response returned by the xquery and writes the XML document to the collection. > > Chrome displays a submit error in the debug log: > 0 -> Submit put - undefined - http://localhost:8005/crv/basic-crud/savehttpput.xqy - true > 91 -> NETWORK_ERR: XMLHttpRequest Exception 101 > > Firefox 3.5 also displays an error in the log > 0 -> Submit put - undefined - http://localhost:8005/crv/basic-crud/savehttpput.xqy - true > 125 -> Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send] > > I'm pasting in the xq code, the xml instance and the form markup - if there's anything you can spot, I'd really appreciate any thoughts you may have; thanks very much in advance :) > > The XQuery:xqueryversion"1.0-ml";declarefunctionlocal:updateNode(){let$form-data:= xdmp:get-request-body()/node()return$form-data};xdmp:document-insert > < > < > { > </ > > The XML instance:<?xml version="1.0" encoding="UTF-8"?><itemxmlns=""></item> > > The XForm markup:<?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?> > <?xsltforms-options debug="yes"?><htmlxmlns="http://www.w3.org/1999/xhtml"xmlns:xf="http://www.w3.org/2002/xforms"xmlns:ev="http://www.w3.org/2001/xml-events"><head><title>XSLTForms - Basic Submission PUT example</title><xf:model><xf:instanceid="default"src="test-instance.xml"/><xf:submissionid="save"method="put"action="http://localhost:8005/xqueries/savehttpput.xqy"><xf:togglecase="case-busy"ev:event="xforms-submit"/><xf:togglecase="case-submit-done"ev:event="xforms-submit-done"/><xf:togglecase="case-submit-error"ev:event="xforms-submit-error"/></xf:submission></xf:model></head><body><xf:inputref="/item/name"><xf:label>Name: </xf:label></xf:input></html><xf:submitclass="store"submission="save"><xf:label>Save</xf:label></xf:submit><xf:switch><xf:caseid="ready"/><xf:caseid="case-busy"><p>Waiting for results from server...</p></xf:case><xf:caseid="case-submit-error"><p>Submit error</p></xf:case><xf:caseid="case-submit-done"><p>Submit > done</p></xf:case></xf:switch></body><name>simple doc content</name> > > > > > > > ("xml-doc-name-here.xml", item>{local:updateNode()}</item>,xdmp:default-permissions(),"collection-name-here"), result>xdmp:get-request-body()/node()}result> > > > > > |