Source Code : Performing XSL Transformations
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
Performing XSL Transformations
<%@ page language="java" contentType="text/html" %>
<%@ page pageEncoding="UTF-8"%>
<%@ page import="javax.xml.transform.*"%>
<%@ page import="javax.xml.transform.stream.*"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Customer Orders</title>
</head>
<body>
<h1>Customer Orders</h1>
<%! String FS = System.getProperty("file.separator"); %>
<%
String xmlFile = request.getParameter("XML");
String xslFile = request.getParameter("XSL");
String ctx = getServletContext().getRealPath("") + FS;
xslFile = ctx + xslFile;
xmlFile = ctx + xmlFile;
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer(new StreamSource(xslFile));
transformer.transform(new StreamSource(xmlFile), new StreamResult(out));
%>
</body>
</html>
Thank with us