<%@ page contentType="text/html; charset=GB2312" import="java.io.File" %> <%! javax.xml.transform.Templates oTemplates = null; javax.xml.transform.TransformerFactory oFactory = javax.xml.transform.TransformerFactory.newInstance(); javax.xml.transform.stream.StreamSource oInput = null; %> <% if( null == oTemplates ) { oTemplates = oFactory.newTemplates( new javax.xml.transform.stream.StreamSource("FILE:///D:/mytest/xslt/atomtest.xsl") ); } if( null == oInput ) { oInput = new javax.xml.transform.stream.StreamSource(request.getRealPath("/")+"xslt"+File.separator+"atom.xml"); } javax.xml.transform.Transformer transformer = oTemplates.newTransformer(); transformer.transform ( oInput, new javax.xml.transform.stream.StreamResult( out ) ); %>