[Xsltforms-support] saving to dynamic file name
Brought to you by:
alain-couthures
|
From: Sandra B. <sb...@lo...> - 2010-01-20 21:30:00
|
I'm trying to save my instance data into an XML file in Exist using the identifier field as filled out in the form. It works if I hard code the file name but if I try to use xf:resource to generate the file name, the form just gets stuck after I submit. I'd appreciate any suggestions. I'm new to this and not really a programmer so apologies if this is obvious.
Thanks,
Sandy
hard coded:
<!-- Saves the data to a file-->
<xf:submission id="save-to-file" method="put" action="../webdav/db/nlu_test/test2.xml" replace="instance">
<xf:toggle case="case-busy" ev:event="xforms-submit"/>
<xf:toggle case="case-submit-done" ev:event="xforms-submit-done"/>
<xf:toggle case="case-submit-error" ev:event="xforms-submit-error"/>
</xf:submission>
not hard coded:
<!-- Saves the data to a file-->
<xf:submission id="save-to-file" method="put" replace="instance">
<xf:resource value="concat('http://localhost:8080/exist/webdav/db/nlu_test/', instance('mods-data')/identifier,'.xml')"/>
<xf:toggle case="case-busy" ev:event="xforms-submit"/>
<xf:toggle case="case-submit-done" ev:event="xforms-submit-done"/>
<xf:toggle case="case-submit-error" ev:event="xforms-submit-error"/>
</xf:submission>
control in body:
<!--Save to a File-->
<xf:submit class="store" submission="save-to-file">
<xf:label>Save</xf:label>
<xf:action ev:event="DOMActivate">
<xf:setvalue ref="instance('mods-data')/recordInfo/recordChangeDate" value="now()"/>
</xf:action>
</xf:submit>
Sandy Bostian
Content Manager, World Digital Library
Library of Congress
101 Independence Ave., SE
Washington, DC 20540
202.707.2342
sb...@lo...
|