The
transform activity applies a transformation, such as an XSL stylesheet, to XML data and stores the result. A transformation process can contain as many
transform activities as needed; there are no constraints. An abbreviated schema of this schema is presented below:
element transform {
attribute name { xsd:string },
attribute file { xsd:string },
attribute source { xsd:string },
attribute result { xsd:string },
param*
}
element param {
attribute name { xsd:string },
attribute type { xsd:string },
attribute value { xsd:string },
( (element* { text }) | text)?
}
This attribute names the activity. This value MUST be unique across the entire transformmap!
This attribute specifies the transformation file to apply against the 'source'. If this attribute is present, the transformation file will be loaded and compiled at deployment time. If absent, then a pass-through transformation is applied.
This required attribute is a
variable reference to the XML data to which the transformation is applied at runtime. The variable need not be declared prior to its use in a
transform activity. If the variable is uninitialized, the transformation will be applied against an empty document.
This required attribute is a
variable reference to which the transformation result is assigned.
The example below uses XSL, but the
transform activity is processor-agnostic. Replace the "file" attribute with an XQuery script, for example, and the activity definition could otherwise remain unchanged. Also, note the 'literal' parameter defined within the activity itself. For more information on parameters, please review the
TransformSL Param wiki page.
<transform name="Transform1"
file="EmplInput2Output.xsl"
source="$input-msg.empl-in"
result="$output-msg.empl-out">
<!--
parameter name MUST match global param declaration in transformation file
-->
<param name="newAddress" type="literal">
<empl:address xmlns:empl="http://open-esb.org">
<empl:street>123 Main Street</empl:street>
<empl:zipcode>98765</empl:zipcode>
</empl:address>
</param>
</transform>
For a summary of TransformSL wiki pages, please see the
TransformSL Links wiki.