1 16 package org.apache.taglibs.xsl; 17 18 23 24 import java.io.Writer ; 25 import javax.servlet.jsp.JspException ; 26 import org.xml.sax.SAXException ; 27 import org.apache.xalan.xslt.XSLTProcessorFactory; 28 import org.apache.xalan.xslt.XSLTInputSource; 29 import org.apache.xalan.xslt.XSLTResultTarget; 30 import org.apache.xalan.xslt.XSLTProcessor; 31 32 33 public class XalanXSLProcessor implements XSLProcessor { 34 35 public void process(String url, String xsl, Writer out) 36 throws JspException { 37 38 try { 39 XSLTProcessor processor = XSLTProcessorFactory.getProcessor(); 42 43 processor.process(new XSLTInputSource(url), 46 new XSLTInputSource(xsl), 47 new XSLTResultTarget(out)); 48 } catch(SAXException sexp) { 49 throw new JspException ("SAXParser Exception: " + sexp.getMessage()); 50 } 51 } 52 } 53 54 55 56 57 58 59 60 61 62 63 | Popular Tags |