Package org.apache.xalan.xsltc.trax

Examples of org.apache.xalan.xsltc.trax.DOM2SAX


        // Copy all the nodes in the nodelist to be under the top element
        copyNodes(nodeList, doc, topElementNode);
       
  // w3c DOM -> DOM2SAX -> DOMBuilder -> DOMImpl
  DOMImpl idom = new DOMImpl();
  final DOM2SAX dom2sax = new DOM2SAX(doc);
  final DOMBuilder domBuilder = idom.getBuilder();
  dom2sax.setContentHandler(domBuilder);
  try {
      dom2sax.parse();
  }
        catch (java.io.IOException e){
      runTimeError(RUN_TIME_INTERNAL_ERR, e.getMessage());
            return null;
  }
View Full Code Here


        // Copy all the nodes in the nodelist to be under the top element
        copyNodes(nodeList, doc, topElementNode);
       
  // w3c DOM -> DOM2SAX -> DOMBuilder -> DOMImpl
  DOMImpl idom = new DOMImpl();
  final DOM2SAX dom2sax = new DOM2SAX(doc);
  final DOMBuilder domBuilder = idom.getBuilder();
  dom2sax.setContentHandler(domBuilder);
  try {
      dom2sax.parse();
  }
        catch (java.io.IOException e){
      runTimeError(RUN_TIME_INTERNAL_ERR, e.getMessage());
            return null;
  }
View Full Code Here

        if ((null != source) && source instanceof DOMSource)
        {
            final DOMSource domsrc = (DOMSource) source;
            final org.w3c.dom.Node node = domsrc.getNode();
            final DOM2SAX dom2sax = new DOM2SAX(node);
     
            SAXImpl dtm;

            if (size <= 0) {
                dtm = new SAXImpl(this, source, documentID,
                                  whiteSpaceFilter, null, doIndexing,
                                  DTMDefaultBase.DEFAULT_BLOCKSIZE,
                                  buildIdIndex, newNameTable);
            } else {
                dtm = new SAXImpl(this, source, documentID,
                                  whiteSpaceFilter, null, doIndexing,
                                  size, buildIdIndex, newNameTable);
            }
     
            dtm.setDocumentURI(source.getSystemId());

            addDTM(dtm, dtmPos, 0);
     
            dom2sax.setContentHandler(dtm);
     
            try {
                dom2sax.parse();
            }
            catch (RuntimeException re) {
                throw re;
            }
            catch (Exception e) {
View Full Code Here

        if ((null != source) && source instanceof DOMSource)
        {
            final DOMSource domsrc = (DOMSource) source;
            final org.w3c.dom.Node node = domsrc.getNode();
            final DOM2SAX dom2sax = new DOM2SAX(node);
     
            SAXImpl dtm;

            if (size <= 0) {
                dtm = new SAXImpl(this, source, documentID,
                                  whiteSpaceFilter, null, doIndexing,
                                  DTMDefaultBase.DEFAULT_BLOCKSIZE,
                                  buildIdIndex, newNameTable);
            } else {
                dtm = new SAXImpl(this, source, documentID,
                                  whiteSpaceFilter, null, doIndexing,
                                  size, buildIdIndex, newNameTable);
            }
     
            dtm.setDocumentURI(source.getSystemId());

            addDTM(dtm, dtmPos, 0);
     
            dom2sax.setContentHandler(dtm);
     
            try {
                dom2sax.parse();
            }
            catch (RuntimeException re) {
                throw re;
            }
            catch (Exception e) {
View Full Code Here

        }
        return new DOMSource(document, systemId);
    }

    public SAXSource toSAXSourceFromDOM(DOMSource source) {
        DOM2SAX converter = new DOM2SAX(source.getNode());
        String systemId = converter.getSystemId();
        return new SAXSource(converter, new InputSource(systemId));
    }
View Full Code Here

        if ((null != source) && source instanceof DOMSource)
        {
            final DOMSource domsrc = (DOMSource) source;
            final org.w3c.dom.Node node = domsrc.getNode();
            final DOM2SAX dom2sax = new DOM2SAX(node);
     
            SAXImpl dtm;

            if (size <= 0) {
                dtm = new SAXImpl(this, source, documentID,
                          whiteSpaceFilter, null, doIndexing, buildIdIndex);
            } else {
                dtm = new SAXImpl(this, source, documentID,
                          whiteSpaceFilter, null, doIndexing, size, buildIdIndex);
            }
     
            dtm.setDocumentURI(source.getSystemId());

            addDTM(dtm, dtmPos, 0);
     
            dom2sax.setContentHandler(dtm);
     
            try {
                dom2sax.parse();
            }
            catch (RuntimeException re) {
                throw re;
            }
            catch (Exception e) {
View Full Code Here

        }
        return new DOMSource(document, systemId);
    }

    public SAXSource toSAXSourceFromDOM(DOMSource source) {
        DOM2SAX converter = new DOM2SAX(source.getNode());
        String systemId = converter.getSystemId();
        return new SAXSource(converter, new InputSource(systemId));
    }
View Full Code Here

        if ((null != source) && source instanceof DOMSource)
        {
            final DOMSource domsrc = (DOMSource) source;
            final org.w3c.dom.Node node = domsrc.getNode();
            final DOM2SAX dom2sax = new DOM2SAX(node);
     
            SAXImpl dtm;

            if (size <= 0) {
                dtm = new SAXImpl(this, source, documentID,
                                  whiteSpaceFilter, null, doIndexing,
                                  DTMDefaultBase.DEFAULT_BLOCKSIZE,
                                  buildIdIndex, newNameTable);
            } else {
                dtm = new SAXImpl(this, source, documentID,
                                  whiteSpaceFilter, null, doIndexing,
                                  size, buildIdIndex, newNameTable);
            }
     
            dtm.setDocumentURI(source.getSystemId());

            addDTM(dtm, dtmPos, 0);
     
            dom2sax.setContentHandler(dtm);
     
            try {
                dom2sax.parse();
            }
            catch (RuntimeException re) {
                throw re;
            }
            catch (Exception e) {
View Full Code Here

    return null;
      }
  }
  // w3c DOM -> DOM2SAX -> DOMBuilder -> DOMImpl
  DOMImpl idom = new DOMImpl();
  final DOM2SAX dom2sax = new DOM2SAX(doc);
  final DOMBuilder domBuilder = idom.getBuilder();
  dom2sax.setContentHandler(domBuilder);
  try {
      dom2sax.parse();
  }
        catch (java.io.IOException e){
      runTimeError(RUN_TIME_INTERNAL_ERR, e.getMessage());
            return null;
  }
View Full Code Here

TOP

Related Classes of org.apache.xalan.xsltc.trax.DOM2SAX

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.