mulesoft/mule — pull request #8 by robvalk (2013-04-17 00:24:38+00:00)
Title: MULE-6501 - Handle XSLT parameters with expressions that return

MULE-6501 - Handle XSLT parameters with expressions that return (possibly XML node) objects.

Key use-case now supported is extracting a fragment of an XML payload
via an #[xpath()] expression, and later using this as a input parameter
to an XSLTTransformer.

1. XsltTransformer calls ExpressionManager.evaluate() instead of
ExpressionManager.parse()
2. Converts the returned object to a javax.xml.transform.Source if it is
convertible.
* XMLUtils.toXMLSource() handles conversion of Dom4j nodes as well
as complete documents.
3. Otherwise uses the expression result object as-is for the XSLT
parameter.

The expanded support for Dom4j nodes is because the xpath() function
might return a w3c DOM or Dom4j node depending on what format the
message payload was in. Converting the XSLT parameter to
java.xml.transform.Source allows Saxon to process an XML node parameter
as intended.