Transform XML into HTML using XSLT

Reference :

How to transfrom XML into HTML using XSLT in Java?

public String view() throws SQLException{

//get XML from database before do print

System.out.println(xmlData);  //This is the result when I take the XML from database using hibernate framework.

try {

File file = new File(“xmlFile.xml”);

FileWriter fileWriter = new FileWriter(file);




TransformerFactory tFactory = TransformerFactory.newInstance();

//We will transform xml into HTML using XSLT and save HTML file in local disk D

Transformer transformer = tFactory.newTransformer (

new“copy Path form1.XSL to here”));

transformer.transform( new,  new ( new FileOutputStream(“D:/formWithData.html”)));


catch (Exception e) {

e.printStackTrace( );





One thought on “Transform XML into HTML using XSLT

  1. I’ve been surfing on-line greater than three hours nowadays, but I never found any interesting article like yours.
    It’s pretty price sufficient for me. In my opinion, if all webmasters and bloggers made
    excellent content as you did, the internet can be much more helpful than ever before.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s