You are here

Using AttachFS To Test XSLT Transforms

We have previously demonstrated testing format descriptions using AttachFS. Now with OpenGroupware Coils 0.1.49rc91 you can also list, retrieve, and test XSLT templates stored in the workflow engine [OIE]. XLST transforms are accessible via AttachFS requests at the URL /attachfs/workflow/xslt.

A simple GET request will return a JSON list of the XSLT transforms defined in the workflow engine.

The text of an XLST transform can be retrieved by name as /attachfs/workflow/xslt/templateName.xslt where templateName.xslt is the full name of the template [including the "xslt" file extension]. The response will have a type of application/xml and an Etag which is an MD5 sum of the template contents.

Transforms may be invoked by performing a PUT request to the URL /attachfs/workflow/xslt/templateName.xslt/transform where templateName.xslt is the full name of the template [including the "xslt" file extension]. The Content-Type of the payload of the PUT request must be appropriate content for the transformation. The result of a successful transform is assumed to be application/xml; if the transform is expected to result in another MIME-type, such as text/plain, the result MIME-type may be overridden my passing a URL parameter of mimetype.

OIE XSLT extension methods are enabled in the transform test as documented for the transformAction; the processId URL parameter allows a process object id to be specified in order to provide a process context for extension method execution. The specified process must exist and be readable by the current security context.

OSSF modules are supported for post-processing transformation results.

curl -v -o response.pdf -H 'Content-Type: application/xml' \
  -T structured.xml -u fred:secret \ '    

Text 1: Transform the contents of the file "standard.xml" using the transform TRWorkorderToRML within the context of the OIE process 347004869. After transformation the data will be processed by the OSSF module "rml".

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer