Java Reference
In-Depth Information
Performing
an
XSL
Transformation
on
BPEL
Message Data
Problem
You want to transform the data in an incoming message before routing its contents to a partner
service.
Solution
Use BPEL's built-in XSLT transformation function, doXslTransform() .
Discussion
Combined with XPath 1.0, BPEL assignment is handy. But when you add the ability to trans-
form in-flight XML data with XSLT, you've got something very powerful. BPEL 2.0 imple-
mentations are required to support the doXslTransform() function.
The function takes the following form:
bpel:doXslTransform(xslStyleSheetPath, sourceDocument,
[paramName, paramValue]*)
Let's break this down to look at the required variables.
The xslStyleSheetPath must be a string literal value that points to the URI of the imported
XSL stylesheet, and it must be available to the compiler at design time. The sourceDocument
refers to the node-set that you want to transform. This is an XML document or fragment avail-
able within a message or variable part.
Finally, you have a pair of optional parameters (demarcated here by square brackets) that may
be used to pass name/value pairs into your XSLT stylesheet if it uses them. The name must be
qualified. Note that the * indicates that you can pass a variable-length list of these name/value
pairs. Passing an odd number of parameters is invalid, and your BPEL compiler will tell you
so.
The result of the transformation is returned by the function so that it can be assigned to another
local variable, or passed into a web service call.
Search WWH ::




Custom Search