I have an xsl script that adds common features to each form build with form builder. I would like for the script to be applied at run-time each time a form is opened. I tried to do the following as explained in http://wiki.orbeon.com/forms/how-to/other/implement-transformation-service:
In /WEB-INF/resources/page-flow.xml I added the following line
...
<page path-info="/fr/([^/]+)/([^/]+)/(new|edit|view)(/([^/]+))?"
matcher="oxf:perl5-matcher" view="test.xsl"/>
...
just before the line
<epilogue url="/config/epilogue.xpl"/>
And I also added the test.xsl in /WEB-INF/resources/apps/fr/ :
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
xsl:template match="@*|node()" name="identity">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/xhtml:html/xhtml:body">
<xsl:copy>
<xforms:output value="'test'"/>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
But the script never gets applied to the forms? How can I correct this?
To do this specifically for Form Runner, you can edit
unroll-form.xpl, and for instance add your transformation before everything else in the pipeline. You would do this by adding after the lastp:param:And then renaming the 2 occurrences of
#datato#transformed-data. (You can of course pick names are more telling of what your transformation does.)