Examples of TransletOutputHandlerFactory


Examples of com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory

    public SerializationHandler openOutputHandler(String filename, boolean append)
  throws TransletException
    {
  try {
      final TransletOutputHandlerFactory factory
    = TransletOutputHandlerFactory.newInstance();

            String dirStr = new File(filename).getParent();
            if ((null != dirStr) && (dirStr.length() > 0)) {
               File dir = new File(dirStr);
               dir.mkdirs();
            }

      factory.setEncoding(_encoding);
      factory.setOutputMethod(_method);
      factory.setWriter(new FileWriter(filename, append));
      factory.setOutputType(TransletOutputHandlerFactory.STREAM);

      final SerializationHandler handler
    = factory.getSerializationHandler();

      transferOutputSettings(handler);
      handler.startDocument();
      return handler;
  }
View Full Code Here

Examples of com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory

                Parameter param = (Parameter) _params.elementAt(i);
                translet.addParameter(param._name, param._value);
            }

            // Transform the document
            TransletOutputHandlerFactory tohFactory =
                TransletOutputHandlerFactory.newInstance();
            tohFactory.setOutputType(TransletOutputHandlerFactory.STREAM);
            tohFactory.setEncoding(translet._encoding);
            tohFactory.setOutputMethod(translet._method);

            if (_iterations == -1) {
                translet.transform(dom, tohFactory.getSerializationHandler());
            }
            else if (_iterations > 0) {
                long mm = System.currentTimeMillis();
                for (int i = 0; i < _iterations; i++) {
                    translet.transform(dom,
                                       tohFactory.getSerializationHandler());
                }
                mm = System.currentTimeMillis() - mm;

                System.err.println("\n<!--");
                System.err.println("  transform  = "
View Full Code Here

Examples of com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory

    public SerializationHandler openOutputHandler(String filename, boolean append)
        throws TransletException
    {
        try {
            final TransletOutputHandlerFactory factory
                = TransletOutputHandlerFactory.newInstance();

            String dirStr = new File(filename).getParent();
            if ((null != dirStr) && (dirStr.length() > 0)) {
               File dir = new File(dirStr);
               dir.mkdirs();
            }

            factory.setEncoding(_encoding);
            factory.setOutputMethod(_method);
            factory.setOutputStream(new BufferedOutputStream(new FileOutputStream(filename, append)));
            factory.setOutputType(TransletOutputHandlerFactory.STREAM);

            final SerializationHandler handler
                = factory.getSerializationHandler();

            transferOutputSettings(handler);
            handler.startDocument();
            return handler;
        }
View Full Code Here

Examples of com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory

    Parameter param = (Parameter) _params.elementAt(i);
    translet.addParameter(param._name, param._value);
      }

      // Transform the document
      TransletOutputHandlerFactory tohFactory =
    TransletOutputHandlerFactory.newInstance();
      tohFactory.setOutputType(TransletOutputHandlerFactory.STREAM);
      tohFactory.setEncoding(translet._encoding);
      tohFactory.setOutputMethod(translet._method);

      if (_iterations == -1) {
    translet.transform(dom, tohFactory.getSerializationHandler());
      }
      else if (_iterations > 0) {
    long mm = System.currentTimeMillis();
    for (int i = 0; i < _iterations; i++) {
        translet.transform(dom,
               tohFactory.getSerializationHandler());
    }
    mm = System.currentTimeMillis() - mm;

    System.err.println("\n<!--");
    System.err.println("  transform  = "
View Full Code Here

Examples of com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory

    public SerializationHandler openOutputHandler(String filename, boolean append)
        throws TransletException
    {
        try {
            final TransletOutputHandlerFactory factory
                = TransletOutputHandlerFactory.newInstance();

            String dirStr = new File(filename).getParent();
            if ((null != dirStr) && (dirStr.length() > 0)) {
               File dir = new File(dirStr);
               dir.mkdirs();
            }

            factory.setEncoding(_encoding);
            factory.setOutputMethod(_method);
            factory.setOutputStream(new BufferedOutputStream(new FileOutputStream(filename, append)));
            factory.setOutputType(TransletOutputHandlerFactory.STREAM);

            final SerializationHandler handler
                = factory.getSerializationHandler();

            transferOutputSettings(handler);
            handler.startDocument();
            return handler;
        }
View Full Code Here

Examples of com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory

                Parameter param = (Parameter) _params.elementAt(i);
                translet.addParameter(param._name, param._value);
            }

            // Transform the document
            TransletOutputHandlerFactory tohFactory =
                TransletOutputHandlerFactory.newInstance();
            tohFactory.setOutputType(TransletOutputHandlerFactory.STREAM);
            tohFactory.setEncoding(translet._encoding);
            tohFactory.setOutputMethod(translet._method);

            if (_iterations == -1) {
                translet.transform(dom, tohFactory.getSerializationHandler());
            }
            else if (_iterations > 0) {
                long mm = System.currentTimeMillis();
                for (int i = 0; i < _iterations; i++) {
                    translet.transform(dom,
                                       tohFactory.getSerializationHandler());
                }
                mm = System.currentTimeMillis() - mm;

                System.err.println("\n<!--");
                System.err.println("  transform  = "
View Full Code Here

Examples of com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory

    public SerializationHandler openOutputHandler(String filename, boolean append)
  throws TransletException
    {
  try {
      final TransletOutputHandlerFactory factory
    = TransletOutputHandlerFactory.newInstance();

            String dirStr = new File(filename).getParent();
            if ((null != dirStr) && (dirStr.length() > 0)) {
               File dir = new File(dirStr);
               dir.mkdirs();
            }

      factory.setEncoding(_encoding);
      factory.setOutputMethod(_method);
      factory.setOutputStream(new BufferedOutputStream(new FileOutputStream(filename, append)));
      factory.setOutputType(TransletOutputHandlerFactory.STREAM);

      final SerializationHandler handler
    = factory.getSerializationHandler();

      transferOutputSettings(handler);
      handler.startDocument();
      return handler;
  }
View Full Code Here

Examples of com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory

                Parameter param = (Parameter) _params.elementAt(i);
                translet.addParameter(param._name, param._value);
            }

            // Transform the document
            TransletOutputHandlerFactory tohFactory =
                TransletOutputHandlerFactory.newInstance();
            tohFactory.setOutputType(TransletOutputHandlerFactory.STREAM);
            tohFactory.setEncoding(translet._encoding);
            tohFactory.setOutputMethod(translet._method);

            if (_iterations == -1) {
                translet.transform(dom, tohFactory.getSerializationHandler());
            }
            else if (_iterations > 0) {
                long mm = System.currentTimeMillis();
                for (int i = 0; i < _iterations; i++) {
                    translet.transform(dom,
                                       tohFactory.getSerializationHandler());
                }
                mm = System.currentTimeMillis() - mm;

                System.err.println("\n<!--");
                System.err.println("  transform  = "
View Full Code Here

Examples of org.apache.xalan.xsltc.runtime.output.TransletOutputHandlerFactory

    // Instanciate and initialise the tranlet object
    AbstractTranslet translet = (AbstractTranslet)tc.newInstance();
    ((AbstractTranslet)translet).setMessageHandler(msgHandler);

    // Create output handler
    TransletOutputHandlerFactory tohFactory =
        TransletOutputHandlerFactory.newInstance();
    tohFactory.setOutputType(TransletOutputHandlerFactory.STREAM);
    tohFactory.setEncoding(translet._encoding);
    tohFactory.setOutputMethod(translet._method);
    tohFactory.setWriter(out);

    getDOM(documentUrl);

    final long start = System.currentTimeMillis();

    // Set size of key/id indices
    translet.setIndexSize(_dom.getSize());
    // If there are any elements with ID attributes, build an index

    _dtdMonitor.buildIdIndex(_dom, 0, translet);
    // Pass unparsed entities to translet
    translet.setUnparsedEntityURIs(_dtdMonitor.
                 getUnparsedEntityURIs());
    // Do the actual transformation
    translet.transform(_dom, tohFactory.getTransletOutputHandler());

    final long done = System.currentTimeMillis() - start;
    out.println("<!-- transformed by XSLTC in "+done+"msecs -->");
      }
      // Now close up the sink, and return the HTML output in the
View Full Code Here

Examples of org.apache.xalan.xsltc.runtime.output.TransletOutputHandlerFactory

    // Read input document from the DOM cache
    DOMImpl dom = getDOM(document, translet);

    // Create output handler
    TransletOutputHandlerFactory tohFactory =
        TransletOutputHandlerFactory.newInstance();
    tohFactory.setOutputType(TransletOutputHandlerFactory.STREAM);
    tohFactory.setEncoding(translet._encoding);
    tohFactory.setOutputMethod(translet._method);
    tohFactory.setWriter(out);

    // Start the transformation
    final long start = System.currentTimeMillis();
    translet.transform(dom, tohFactory.getTransletOutputHandler());
    final long done = System.currentTimeMillis() - start;
    out.println("<!-- transformed by XSLTC in "+done+"msecs -->");
      }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.