Its pretty easy to transform Xml to HTML using Mulesoft's XSLT transform ..
Following is snapshot from my mule's config file ..
The Java component is used to provide following xml as an input :
Following is snapshot from my mule's config file ..
The Java component is used to provide following xml as an input :
<?xml version="1.0"?>
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
</book>
</catalog>
Following is the xsl code :
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" />
<xsl:template match="catalog">
<html>
<body>
<h2>My Book Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Book</th>
<th>Genre</th>
</tr>
<xsl:for-each select="book">
<tr>
<td>
<xsl:value-of select="title" />
</td>
<td>
<xsl:value-of select="genre" />
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Once the flow is executed I can see the final html file being created in the output folder.
I am using file:outbound-endpoint to write the contents in the output file ..