Thread: [Xsltforms-support] change in namespace on post submission
Brought to you by:
alain-couthures
From: Stephen C. <Ste...@ut...> - 2009-07-28 08:55:51
|
Hello, I am experimenting with XSLTForms, I have developed an XForm and want to POST XML to a servlet, however the XML received by the servlet has a namespace change which I don't want. The new namespace is "pre1" and in my form model it was "aatams". The xml received by the servlet is as follows: <Transaction xmlns="http://www.opengis.net/wfs" xmlns:pre1="http://www.imos.org.au/aatams" version="1.1.0" service="WFS"> <Insert> <pre1:Animal> <pre1:animal_id>1</pre1:animal_id> <pre1:classification_id>2</pre1:classification_id> <pre1:name>3</pre1:name> <pre1:display_level_id>4</pre1:display_level_id> <pre1:display_start_date>5</pre1:display_start_date> <pre1:comments>6</pre1:comments> </pre1:Animal> </Insert> </Transaction> The XFORM is as follows: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="xsltforms-beta/xsltforms/xsltforms.xsl" type="text/xsl"?><html xmlns:aatams="http://www.imos.org.au/aatams" xmlns="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>AATAMS Web Interface</title> <link href="aatams.css" rel="stylesheet" type="text/css"/> <xf:model> <xf:instance id="ANIMAL"> <wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:aatams="http://www.imos.org.au/aatams" version="1.1.0" service="WFS"> <wfs:Insert> <aatams:Animal> <aatams:animal_id/> <aatams:classification_id/> <aatams:name/> <aatams:display_level_id/> <aatams:display_start_date/> <aatams:comments/> </aatams:Animal> </wfs:Insert> </wfs:Transaction> </xf:instance> <xf:submission id="s01" method="post" action="test" ref="instance('ANIMAL')"> <xf:message level="modeless" ev:event="xforms-submit-error">Submit error.</xf:message> </xf:submission> </xf:model> </head> <body> <div id="xformControl"> <span> <input type="checkbox" onclick="$('console').style.display = this.checked? 'block' : 'none';" checked="checked"/> Debug </span> </div> <xf:group ref="//aatams:Animal"> <fieldset xmlns=""> <legend>Animal</legend> <xf:input ref="aatams:animal_id"> <xf:label>Animal Id</xf:label> </xf:input> <xf:input ref="aatams:classification_id"> <xf:label>Classification Id</xf:label> </xf:input> <xf:input ref="aatams:name"> <xf:label>Name</xf:label> </xf:input> <xf:input ref="aatams:display_level_id"> <xf:label>Display Level Id</xf:label> </xf:input> <xf:input ref="aatams:display_start_date"> <xf:label>Display Start Date</xf:label> </xf:input> <xf:input ref="aatams:comments"> <xf:label>Comments</xf:label> </xf:input> </fieldset> </xf:group> <xf:submit submission="s01"> <xf:label>Save</xf:label> </xf:submit> <xf:trigger> <xf:label>Reset</xf:label> <xf:reset ev:event="DOMActivate"/> </xf:trigger> <br/> <div id="console"/> </body> </html> Thanks for your assistance. Regards Stephen Cameron Data Programmer Integrated Marine Observing System (IMOS) eMarine Information Infrastructure Project University of Tasmania, Private Bag 21, Hobart, TAS 7001, Australia Tel: +61 3 6226 8507 Fax: +61 3 6226 2997 Email: ste...@ut... URL: http://www.imos.org.au/eMII.html |
From: COUTHURES A. <ala...@ag...> - 2009-07-28 09:06:10
|
Hello Stephen, > I am experimenting with XSLTForms, I have developed an XForm and want to > POST XML to a servlet, however the XML received by the servlet has a > namespace change which I don't want. The new namespace is "pre1" and in > my form model it was "aatams". > "pre1" and "aatams" are just prefixes associated to namespaces and the serialized XML produced by XSLTForms is correct. The servlet shouldn't interpret the prefixes but the namespaces : an XML document is to be interpreted with an XML library, even regular expressions can't interpret XML easily... For human beings, it would be better if XSLTForms was reusing the same prefixes. This might be considered in a next version Thanks! -Alain |