Reputation: 287
Given a DataMapper node that would map between the following two structures:
Strcuture A:
<item>
<id>123</id>
<price>1</price>
<quantity>1</quantity>
</item>
<item>
<id>124</id>
<price>2</price>
<quantity>1</quantity>
</item>
<item>
<id>125</id>
<price>3</price>
<quantity>1</quantity>
</item>
Structure B:
<total>
<totalPrice>6</totalPrice>
</total>
The Mule ESB DataMapper will generate a CTL2 (Clover) Transformation.
Can the Mule ESB DataMapper also generate XSLT
Upvotes: 0
Views: 328
Reputation: 43
You can use XSLT component and provide an xsl file. This xsl file would be convert between 2 different sml formats.
Below is the example of mule flow for the same.
<file:connector name="File" autoDelete="true" streaming="true" validateConnections="true" doc:name="File"/>
<flow name="xsltexampleFlow">
<file:inbound-endpoint path="D:\Mule_Work\Input" connector-ref="File" responseTimeout="10000" doc:name="File"/>
<logger message="------------------File Read------------" level="INFO" doc:name="Logger"/>
<mulexml:xslt-transformer xsl-file="D:\Mule_Work\Output\transform.xsl" maxIdleTransformers="2" maxActiveTransformers="5" doc:name="XSLT"/>
<logger level="INFO" doc:name="Logger" message="--------------XSL Transformation---------------------"/>
<file:outbound-endpoint path="D:\Mule_Work\Output" outputPattern="Output_transform.xml" connector-ref="File" responseTimeout="10000" doc:name="File"/>
</flow>
Upvotes: 0
Reputation: 5115
Do you mean to perform a XML transformation? Because if this is the case then yes.
If what you mean is to generate XSLT, technically I can, but makes no sense as XSLT is not meant to contain information but rather to transform it.
Upvotes: 1
Reputation: 8311
I guess XSLT (Extensible Stylesheet Language Transformations) is a language for transforming XML documents into other XML documents and I am afraid Data mapper cannot generate a XSLT ...
you can always use Mule XSLT transformer separately to transform data into your expected format of XML:- http://www.mulesoft.org/documentation/display/current/XSLT+Transformer
Upvotes: 1