}
@Override
public Transformer getTransformer() throws Exception
{
XQueryTransformer transformer = new XQueryTransformer();
transformer.setXquery(
"declare variable $document external;\n" +
"declare variable $title external;\n" +
"declare variable $rating external;\n" +
" <cd-listings title='{$title}' rating='{$rating}'>\n" +
"{\n" +
" for $cd in $document/catalog/cd\n" +
" return <cd-title>{data($cd/title)}</cd-title>\n" +
"} \n</cd-listings>");
transformer.setReturnDataType(DataTypeFactory.STRING);
Map<String, Object> params = new HashMap<String, Object>();
params.put("title", "#[header:ListTitle]");
params.put("rating", "#[header:ListRating]");
transformer.setContextProperties(params);
transformer.setMuleContext(muleContext);
transformer.initialise();
return transformer;
}