The problemYou want to run an XSLT transformation on a document you have in an instance directly from XForms, with the XSLT transformation available in another instance.See also: Run an external XSLT transformation from XForms The solutionThe core of the solution is to use the Saxon extension functionsaxon:transform() which allows you to run XSLT from XPath. The example linked below uses 3 instances to hold the input document you want to transform, the XSLT stylesheet, and the result of the transformation:<xforms:instance id="input"> ... </xforms:instance><xforms:instance id="stylesheet"> ... </xforms:instance><xforms:instance id="output"> ... </xforms:instance>You run the transformation with the following action: <xforms:insert nodeset="instance('output')" origin="saxon:transform( saxon:compile-stylesheet(instance('stylesheet')/root()), saxon:parse(saxon:serialize(instance('input'), 'xml')))"/>In the future, Orbeon Forms can make this use of saxon:transform() more efficient by allowing the compiled stylesheet to be cached (so it doesn't need to be compiled every time the transformation runs), and by removing the need to use the saxon:parse() and saxon:serialize() on the input document.Run it and get the source |