Package com.jclark.xsl.sax

Examples of com.jclark.xsl.sax.XSLProcessorImpl


   public void xmlOutput( String xmlData, String dir, String template, HttpServletResponse response ) throws ServletException
   {
      try {
         response.setContentType("text/html");

         XSLProcessorImpl xsl = getStylesheet( dir, template );
         OutputMethodHandlerImpl outputMethodHandler =
                                      new OutputMethodHandlerImpl(xsl);

         xsl.setOutputMethodHandler(outputMethodHandler);

         outputMethodHandler.setDestination( new ServletDestination(response) );

         xsl.parse( new InputSource( new StringReader( xmlData ) ) );

      }
      catch(Exception e) {
         log.warning("servlet output broken:"+e.toString());
         throw new ServletException(e.toString());
View Full Code Here


   public void fileXmlOutput( String fileName, String dir, String template, HttpServletResponse response ) throws ServletException
   {
      try {
         response.setContentType("text/html");

         XSLProcessorImpl xsl = getStylesheet( dir, template );
         OutputMethodHandlerImpl outputMethodHandler =
                                      new OutputMethodHandlerImpl(xsl);

         xsl.setOutputMethodHandler(outputMethodHandler);

         outputMethodHandler.setDestination( new ServletDestination(response) );

         xsl.parse( new InputSource( (new URL( "file:"+fileName )).toString() ) );

      }
      catch(Exception e) {
         log.warning("servlet output broken:"+e.toString());
         throw new ServletException(e.toString());
View Full Code Here

   public XSLProcessorImpl getStylesheet( String reqDir, String xslFile ) throws XmlBlasterException, IOException
   {

      String xslPath = reqDir+"/"+xslFile+".xsl";

      XSLProcessorImpl xsl  = new XSLProcessorImpl();
      xsl.setParser(createParser());

      try {
         String url = new URL("file", "", xslPath).toString();
         log.info("Reading from "+url);
         xsl.loadStylesheet( new InputSource( new URL("file", "", xslPath).toString() ) );
         log.info("Successfully read from "+url);
      }
      catch ( Exception e) {
         log.severe(e.toString());
         throw new XmlBlasterException(ME,"Could not read XSL file.");
View Full Code Here

  if (parser == null) {
      MessageHandler.errorln("ERROR: Unable to create SAX parser");
      System.exit(1);
  }
 
  XSLProcessor xslProcessor = new XSLProcessorImpl();
  xslProcessor.setParser(parser);
 
  try {
      xslProcessor.loadStylesheet(fileInputSource(args[1]));

      XTDriver driver = new XTDriver();
      driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer",
             version);
      driver.addElementMapping("org.apache.fop.fo.StandardElementMapping");
View Full Code Here

  if (parser == null) {
      System.err.println("ERROR: Unable to create SAX parser");
      System.exit(1);
  }
 
  XSLProcessor xslProcessor = new XSLProcessorImpl();
  xslProcessor.setParser(parser);
 
  try {
      xslProcessor.loadStylesheet(fileInputSource(args[1]));

      Driver driver = new Driver();
      driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer",
             version);
      driver.addElementMapping("org.apache.fop.fo.StandardElementMapping");
View Full Code Here

  if (parser == null) {
      MessageHandler.errorln("ERROR: Unable to create SAX parser");
      System.exit(1);
  }
 
  XSLProcessor xslProcessor = new XSLProcessorImpl();
  xslProcessor.setParser(parser);
 
  try {
      xslProcessor.loadStylesheet(fileInputSource(args[1]));

      XTDriver driver = new XTDriver();
      driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer",
             version);
      driver.addElementMapping("org.apache.fop.fo.StandardElementMapping");
View Full Code Here

  if (parser == null) {
      System.err.println("ERROR: Unable to create SAX parser");
      System.exit(1);
  }
 
  XSLProcessor xslProcessor = new XSLProcessorImpl();
  xslProcessor.setParser(parser);
 
  try {
      xslProcessor.loadStylesheet(fileInputSource(args[1]));

      Driver driver = new Driver();
      driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer",
             version);
      driver.addElementMapping("org.apache.fop.fo.StandardElementMapping");
View Full Code Here

TOP

Related Classes of com.jclark.xsl.sax.XSLProcessorImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.