Examples of SAXOutputter


Examples of org.jdom.output.SAXOutputter

        reorderDOM(element, getNamespace());

        FormatHandler handler = new FormatHandler(this);
        handler.setEnconding(encoding);
        SAXOutputter saxo = new SAXOutputter(handler);
        saxo.output(element);

        return handler.getXML();
    }
View Full Code Here

Examples of org.jdom.output.SAXOutputter

    FormatHandler handler = new FormatHandler(this);
    handler.setStyleSheet(styleSheet);
    handler.setEnconding(encoding);

    SAXOutputter saxo = new SAXOutputter(handler);    

    saxo.output(getDoc());

    //Document doc  = null;
    try {
      getBuilder(true).build(new StringReader(handler.getXML()));
    } catch (JDOMException e) {
View Full Code Here

Examples of org.jdom.output.SAXOutputter

    reorderDOM(doc.getRootElement());

    FormatHandler handler = new FormatHandler(this);
    handler.setStyleSheet(styleSheet);
    handler.setEnconding(encoding);
     SAXOutputter saxo = new SAXOutputter(handler);
    //saxo.output(getDoc());
    saxo.output(doc);

    try {
      getBuilder(false).build(new StringReader(handler.getXML()));
    } catch (JDOMException e) {
      try {
View Full Code Here

Examples of org.jdom.output.SAXOutputter

        try {
            Verifier verifier = this.newVerifier();
            verifier.setErrorHandler(errorHandler);

            errorHandler.setContentHandler(verifier.getVerifierHandler());
            new SAXOutputter(errorHandler).output(doc);
        }
        catch (SAXException e) { /* Fatal validation error encountered. */
        }

        // Retrieve validation errors, if any.
View Full Code Here

Examples of org.jdom.output.SAXOutputter

            List nodes = new ArrayList();
            nodes.add(element);

            errorHandler.setContentHandler(verifier.getVerifierHandler());
            new SAXOutputter(errorHandler).output(nodes);
        }
        catch (SAXException e) { /* Fatal validation error encountered. */
        }

        // Retrieve validation errors, if any.
View Full Code Here

Examples of org.jdom.output.SAXOutputter

        // create an XPathTracker
        XPathTracker tracker = new XPathTracker(document.getRootElement());

        // create a SAXOutputter
        SAXOutputter outputter = new SAXOutputter();
        // Set the ContentHandler of the outputter to an instance of
        // the XPathTrakerFeeder class. The XPathTrackerFeeder class
        // ensures that the tracker receives all startElement and endElement
        // events. In addition, it also checks that the trackers current
        // xpath matches an expected xpath.
        outputter.setContentHandler(new XPathTrackerFeeder(tracker));
        // output the document
        outputter.output(document);

    }
View Full Code Here

Examples of org.jdom.output.SAXOutputter

      if (sd.size () == 0) {
    return org.w3c.dom.Element.class;
      }
      SAXEventBufferImpl seb = new SAXEventBufferImpl ();
      try {
    (new SAXOutputter (seb)).output (sd);
      } catch (JDOMException e) {
    new IllegalArgumentException ("Cannot convert schema to SAX: "
                + e.getMessage ());
      }
      seb.pack();
View Full Code Here

Examples of org.jdom.output.SAXOutputter

     * @throws ImportException if the XPDL is not correct.
     */
    public DefaultProcessDefinition (Document processDefinition)
  throws JDOMException, ImportException {
  try {
      SAXOutputter outputter = new SAXOutputter();
      procDef = new SAXEventBufferImpl ();
      outputter.setContentHandler(procDef);
      outputter.setLexicalHandler(procDef);
      outputter.output (processDefinition);
  } catch (JDOMException e) {
      String s = "Cannot get XPDL from DOM: " + e.getMessage();
      logger.error (s, e);
      throw new IllegalArgumentException (s);
  }
View Full Code Here

Examples of org.jdom.output.SAXOutputter

    }

    private void subtreeToSAX (Element e, ContentHandler h) {
  try {
      SAXEventBufferImpl buf = new SAXEventBufferImpl ();
      SAXOutputter out = new SAXOutputter (buf);
      out.output(new Document((Element)e.clone()));
      HandlerStack hs = new HandlerStack (h);
      buf.emit (hs.contentHandler());
  } catch (JDOMException ex) {
      throw new IllegalArgumentException (ex.getMessage ());
  } catch (SAXException ex) {
View Full Code Here

Examples of org.jdom.output.SAXOutputter

    try {
        if (logger.isDebugEnabled ()) {
      logger.debug
          ("Convering item " + name + " from JDOM to SAX");
        }
        SAXOutputter outputter = new SAXOutputter();
        SAXEventBufferImpl b = new SAXEventBufferImpl ();
        outputter.setContentHandler(b);
        outputter.setLexicalHandler(b);
        if (v instanceof Document) {
      outputter.output ((Document)v);
        } else {
      List l;
      if (v instanceof List) {
          l = (List)v;
      } else {
          l = new ArrayList ();
          l.add (v);
      }
      outputter.output (l);
        }
        b.pack();
        v = b;
        newValues.put (name, v);
    } catch (JDOMException e) {
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.