Eric van der Vlist wrote:
Right now, it's working exactly as you describe if I write:
<action when="/form/action = 'save' and not(/form/document//[EMAIL PROTECTED]:valid = 'false' and not(ancestor-or-self::[EMAIL PROTECTED]:relevant = 'false'])]) " action="save-new-document.xpl"> <result page="apiculteur"> <xu:update select="/form/document-id"> <xu:value-of select="translate(normalize-space(document('oxf:instance')/form/document/rdf:RDF/bk:beekeeper/bk:name), ' AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz������������� �����������������������������������������������', '+aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaaaaaaaaaaaa� �cceeeeeeeeiiiiiiii��nnoooooooooo��uuuuuuuuyy��')" /> </xu:update> <xu:remove select="/form/*[not(self::document-id)]"/> </result> </action>
The issue with this solution is that I need to duplicate the logic that computes an ID from the document.
Right now, this is *only* more difficult to maintain (I need to update this logic at two locations).
And, in the future, I might have to extend this algorithm (for instance to check for duplicates in the database) and it might even become impossible to implement with pure XPath.
This ID being already computed in the action, is there a way to pass its value from the action to the update statement?
Yes, document('input:action')/whatever/is/in/your/action.
-Erik
------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ orbeon-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/orbeon-user
