The problem XForms features a series of data manipulation actions:
See also: Run an embedded XSLT transformation from XForms The service solutionA simple, cross-implementation solution consists in sending the XML data to transform to a service. The service performs the transformation, and returns the result.A submission can look like this: <xforms:submission id="transform-submission" method="post" ref="instance('source')" resource="http://example.org/service/transform" replace="instance" instance="destination"/>This submission:
You can (but you don't have to!) implement a transformation service directly in Orbeon Forms. See Implement a transformation service for details about how to implement a transformation service. The call-xpl() solutionOrbeon XForms also features an extension XPath function,xxforms:call-xpl(). This function allows calling an XPL pipeline directly, without exposing it as a service.In this case, instead of using a submission, use <xforms:insert>:<xforms:insert nodeset="instance('destination')" origin="xxforms:call-xpl('oxf:/apps/my-app/my-transform.xpl', 'data',/>This:
xxforms:call-xpl() function parameters are:
<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:oxf="http://www.orbeon.com/oxf/processors"> <p:param type="input" name="data"/> <p:param type="output" name="data"/> <p:processor name="oxf:xslt"> <p:input name="data" href="#data"/> <p:input name="config" href="my-transform.xsl"/> <p:output name="data" ref="data"/> </p:processor></p:config>NOTE: If you are using separate deployment, the service and XSLT transformation must be present in the Orbeon WAR file, instead of within your application. |