XSL Integration
blep Nov 13, 2008 8:51 AMHi
My application have to apply XSL transformation to XML documents, of course a esb service using smooks can handle this job. An other requirement for my application is to empower users to publish new transformation services based on XSL.
To do so, they have to set the service configuration file, the smooks resource file with the XSL location AND the selector with the root element.
This process is not so complicated but from user view you can imagine that it is not so easy to understand why they have to set this smooks res file. And if a user just want to set a service with a XSL without any XSL skills, it is not possible because he has to know the root element, as smooks is fragment based.
The target process (the one we'd like!) is : set the service up and just set the XSL location and deploy.
So my questions are:
- In the message transformation guide, I read:
In this release of JBossESB, XSL Transformations are supported through Smooks. In later releases we may support XSLT natively. Support for XSLT can be provided by creating a custom org.jboss.soa.esb.actions.ActionProcessor implementation.. Do you know when this feature will be available?
- If not, is there any way, in smooks, to select the root element without knowing it (like selector="/" maybe?)?
- If not, is there any way to give smooks paramters in order to have only the jboss-esb.xml file to set? Something like:
jboss-esb.xml:
<action name="transform" class="org.jboss.soa.esb.actions.smooks.SmooksAction"> <property name="smooksConfig" value="smooks-config.xml" /> <property name="xslFile" value=sheet.xsl"/> <property name="rootNode" value="myRoot"/> </action>
a generic smooks-confi.xml for all XSL transformations:
<?xml version="1.0"?> <smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd"> <resource-config selector="${rootNode}"> <resource>${xslFile}</resource> <param name="is-xslt-templatelet">false</param> </resource-config> </smooks-resource-list>