Examples of SAXImpl


Examples of com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl

     * Internal interface which returns a DOM for a given DTMManager and translet.
     */
    protected DOM getDOM(XSLTCDTMManager dtmManager, AbstractTranslet translet)
        throws SAXException
    {
        SAXImpl idom = (SAXImpl)_dom.get();

        if (idom != null) {
            if (dtmManager != null) {
                idom.migrateTo(dtmManager);
            }
        }
        else {
            Source source = _source;
            if (source == null) {
                if (_systemId != null && _systemId.length() > 0) {
                    source = new StreamSource(_systemId);
                }
                else {
                    ErrorMsg err = new ErrorMsg(ErrorMsg.XSLTC_SOURCE_ERR);
                    throw new SAXException(err.toString());
                }
            }

            DOMWSFilter wsfilter = null;
            if (translet != null && translet instanceof StripFilter) {
                wsfilter = new DOMWSFilter(translet);
            }

            boolean hasIdCall = (translet != null) ? translet.hasIdCall() : false;

            if (dtmManager == null) {
                dtmManager = XSLTCDTMManager.newInstance();
            }

            idom = (SAXImpl)dtmManager.getDTM(source, true, wsfilter, false, false, hasIdCall);

            String systemId = getSystemId();
            if (systemId != null) {
                idom.setDocumentURI(systemId);
            }
            _dom.set(idom);
        }
        return idom;
    }
View Full Code Here

Examples of com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl

     * Internal interface which returns a DOM for a given DTMManager and translet.
     */
    protected DOM getDOM(XSLTCDTMManager dtmManager, AbstractTranslet translet)
        throws SAXException
    {
        SAXImpl idom = (SAXImpl)_dom.get();
               
        if (idom != null) {
            if (dtmManager != null) {
                idom.migrateTo(dtmManager);
            }
        }
        else {
            Source source = _source;
            if (source == null) {
                if (_systemId != null && _systemId.length() > 0) {
                    source = new StreamSource(_systemId);
                }
                else {
                    ErrorMsg err = new ErrorMsg(ErrorMsg.XSLTC_SOURCE_ERR);
                    throw new SAXException(err.toString());
                }
            }
           
            DOMWSFilter wsfilter = null;
            if (translet != null && translet instanceof StripFilter) {
                wsfilter = new DOMWSFilter(translet);
            }
               
            boolean hasIdCall = (translet != null) ? translet.hasIdCall() : false;
           
            if (dtmManager == null) {
                dtmManager = XSLTCDTMManager.newInstance();
            }
           
            idom = (SAXImpl)dtmManager.getDTM(source, true, wsfilter, false, false, hasIdCall);
           
            String systemId = getSystemId();
            if (systemId != null) {
                idom.setDocumentURI(systemId);
            }
            _dom.set(idom);
        }
        return idom;
    }
View Full Code Here

Examples of com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl

     * Internal interface which returns a DOM for a given DTMManager and translet.
     */
    protected DOM getDOM(XSLTCDTMManager dtmManager, AbstractTranslet translet)
        throws SAXException
    {
        SAXImpl idom = (SAXImpl)_dom.get();

        if (idom != null) {
            if (dtmManager != null) {
                idom.migrateTo(dtmManager);
            }
        }
        else {
            Source source = _source;
            if (source == null) {
                if (_systemId != null && _systemId.length() > 0) {
                    source = new StreamSource(_systemId);
                }
                else {
                    ErrorMsg err = new ErrorMsg(ErrorMsg.XSLTC_SOURCE_ERR);
                    throw new SAXException(err.toString());
                }
            }

            DOMWSFilter wsfilter = null;
            if (translet != null && translet instanceof StripFilter) {
                wsfilter = new DOMWSFilter(translet);
            }

            boolean hasIdCall = (translet != null) ? translet.hasIdCall() : false;

            if (dtmManager == null) {
                dtmManager = XSLTCDTMManager.newInstance();
            }

            idom = (SAXImpl)dtmManager.getDTM(source, true, wsfilter, false, false, hasIdCall);

            String systemId = getSystemId();
            if (systemId != null) {
                idom.setDocumentURI(systemId);
            }
            _dom.set(idom);
        }
        return idom;
    }
View Full Code Here

Examples of org.apache.xalan.xsltc.dom.SAXImpl

     * Internal interface which returns a DOM for a given DTMManager and translet.
     */
    protected DOM getDOM(XSLTCDTMManager dtmManager, AbstractTranslet translet)
        throws SAXException
    {
        SAXImpl idom = (SAXImpl)_dom.get();
               
        if (idom != null) {
            if (dtmManager != null) {
                idom.migrateTo(dtmManager);
            }
        }
        else {
            Source source = _source;
            if (source == null) {
                if (_systemId != null && _systemId.length() > 0) {
                    source = new StreamSource(_systemId);
                }
                else {
                    ErrorMsg err = new ErrorMsg(ErrorMsg.XSLTC_SOURCE_ERR);
                    throw new SAXException(err.toString());
                }
            }
           
            DOMWSFilter wsfilter = null;
            if (translet != null && translet instanceof StripFilter) {
                wsfilter = new DOMWSFilter(translet);
            }
               
            boolean hasIdCall = (translet != null) ? translet.hasIdCall() : false;
           
            if (dtmManager == null) {
                dtmManager = XSLTCDTMManager.newInstance();
            }
           
            idom = (SAXImpl)dtmManager.getDTM(source, true, wsfilter, false, false, hasIdCall);
           
            String systemId = getSystemId();
            if (systemId != null) {
                idom.setDocumentURI(systemId);
            }
            _dom.set(idom);
        }
        return idom;
    }
View Full Code Here

Examples of org.apache.xalan.xsltc.dom.SAXImpl

     * Internal interface which returns a DOM for a given DTMManager and translet.
     */
    protected DOM getDOM(XSLTCDTMManager dtmManager, AbstractTranslet translet)
        throws SAXException
    {
        SAXImpl idom = (SAXImpl)_dom.get();
               
        if (idom != null) {
            if (dtmManager != null) {
                idom.migrateTo(dtmManager);
            }
        }
        else {
            Source source = _source;
            if (source == null) {
                if (_systemId != null && _systemId.length() > 0) {
                    source = new StreamSource(_systemId);
                }
                else {
                    ErrorMsg err = new ErrorMsg(ErrorMsg.XSLTC_SOURCE_ERR);
                    throw new SAXException(err.toString());
                }
            }
           
            DOMWSFilter wsfilter = null;
            if (translet != null && translet instanceof StripFilter) {
                wsfilter = new DOMWSFilter(translet);
            }
               
            boolean hasIdCall = (translet != null) ? translet.hasIdCall() : false;
           
            if (dtmManager == null) {
                dtmManager = XSLTCDTMManager.newInstance();
            }
           
            idom = (SAXImpl)dtmManager.getDTM(source, true, wsfilter, false, false, hasIdCall);
           
            String systemId = getSystemId();
            if (systemId != null) {
                idom.setDocumentURI(systemId);
            }
            _dom.set(idom);
        }
        return idom;
    }
View Full Code Here

Examples of org.apache.xalan.xsltc.dom.SAXImpl

     */
    private DOM getDOM(Source source, int mask)
  throws TransformerException {
  try {
      DOM dom = null;
      SAXImpl saxImpl = null;
      DTMWSFilter wsfilter;
      if (_translet != null && _translet instanceof StripFilter) {
          wsfilter = new DOMWSFilter(_translet);
            } else {
          wsfilter = null;
            }
           
            boolean hasIdCall = (_translet != null) ? _translet.hasIdCall()
                                                      : false;
      // Get systemId from source
      if (source != null) {
    _sourceSystemId = source.getSystemId();
      }

      if (source instanceof SAXSource) {
    // Get all info from the input SAXSource object
    final SAXSource sax = (SAXSource)source;
    XMLReader reader = sax.getXMLReader();
    final InputSource input = sax.getInputSource();
                final boolean hasUserReader = reader != null;

    // Create a reader if not set by user
    if (reader == null) {
        reader = _tfactory.getXMLReader();
    }

    // Create a new internal DOM and set up its builder to trap
    // all content/lexical events
    XSLTCDTMManager dtmManager = XSLTCDTMManager.newInstance();

                //dtmManager.setIncremental(_isIncremental);
    saxImpl = (SAXImpl)dtmManager.getDTM(sax, false, wsfilter, true, false,
                                                 hasUserReader, 0, hasIdCall);
    //final DOMBuilder builder = ((SAXImpl)dom).getBuilder();
    try {
        reader.setProperty(LEXICAL_HANDLER_PROPERTY, saxImpl);
    }
    catch (SAXException e) {
        // quitely ignored
    }
    reader.setContentHandler(saxImpl);
    reader.setDTDHandler(saxImpl);
    saxImpl.setDocumentURI(_sourceSystemId);
      }
      else if (source instanceof DOMSource) {
    // Create a new internal DTM and build it directly from DOM
    XSLTCDTMManager dtmManager = XSLTCDTMManager.newInstance();
   
                //dtmManager.setIncremental(_isIncremental);
    saxImpl = (SAXImpl)dtmManager.getDTM(source, false, wsfilter, true,
                                                 false, hasIdCall);
    saxImpl.setDocumentURI(_sourceSystemId);
      }
      // Handle StreamSource input
      else if (source instanceof StreamSource) {
    // Get all info from the input StreamSource object
    final StreamSource stream = (StreamSource)source;
    final InputStream streamInput = stream.getInputStream();
    final Reader streamReader = stream.getReader();
    final XMLReader reader = _tfactory.getXMLReader();

    // Create a new internal DOM and set up its builder to trap
    // all content/lexical events
    XSLTCDTMManager dtmManager = XSLTCDTMManager.newInstance();

    //dtmManager.setIncremental(_isIncremental);
   
    InputSource input;
    if (streamInput != null) {
        input = new InputSource(streamInput);
        input.setSystemId(_sourceSystemId);
    }
    else if (streamReader != null) {
        input = new InputSource(streamReader);
        input.setSystemId(_sourceSystemId);
    }
    else if (_sourceSystemId != null)
        input = new InputSource(_sourceSystemId);
    else {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR);
        throw new TransformerException(err.toString());
    }
    saxImpl = (SAXImpl)dtmManager.getDTM(new SAXSource(reader, input),
                                                 false, wsfilter, true,
                                                 false, hasIdCall);
    saxImpl.setDocumentURI(_sourceSystemId);
      }
      else if (source instanceof XSLTCSource) {
    final XSLTCSource xsltcsrc = (XSLTCSource)source;
    dom = xsltcsrc.getDOM();
      }
View Full Code Here

Examples of org.apache.xalan.xsltc.dom.SAXImpl

      final XMLReader reader = parser.getXMLReader();

      // Set the DOM's DOM builder as the XMLReader's SAX2 content handler
            XSLTCDTMManager dtmManager = XSLTCDTMManager.newInstance();

            final SAXImpl dom = (SAXImpl)dtmManager.getDTM(
                             new SAXSource(reader, new InputSource(_fileName)),
                             false, null, true, false, translet.hasIdCall());

      dom.setDocumentURI(_fileName);
            translet.prepassDocument(dom);

      // Pass global parameters
      int n = _params.size();
      for (int i = 0; i < n; i++) {
View Full Code Here

Examples of org.apache.xalan.xsltc.dom.SAXImpl

     * The index contains the element node index (int) and Id value (String).
     */
    private final void buildIDIndex(DOM document) {
       
        if (document instanceof SAXImpl) {
            SAXImpl saxImpl = (SAXImpl)document;
           
            // If the input source is DOMSource, the KeyIndex table is not
            // built at this time. It will be built later by the lookupId()
            // and containsId() methods of the KeyIndex class.
            if (saxImpl.hasDOMSource()) {
                buildKeyIndex(ID_INDEX_NAME, document);
                return;
            }
            else {
                final Hashtable elementsByID = saxImpl.getElementsWithIDs();

                if (elementsByID == null) {
                  return;
                }

View Full Code Here

Examples of org.apache.xalan.xsltc.dom.SAXImpl

            final MultiDOM multiDOM = (MultiDOM) dom;

      DTMDefaultBase dtm = (DTMDefaultBase)((DOMAdapter)multiDOM.getMain()).getDOMImpl();
      DTMManager dtmManager = dtm.getManager();
     
      SAXImpl idom = (SAXImpl)dtmManager.getDTM(new DOMSource(doc), false,
                  null, true, false);
      // Create DOMAdapter and register with MultiDOM
      DOMAdapter domAdapter = new DOMAdapter(idom,
                translet.getNamesArray(),
    translet.getNamespaceArray());
            multiDOM.addDOMAdapter(domAdapter);

      DTMAxisIterator iter1 = idom.getAxisIterator(Axis.CHILD);
      DTMAxisIterator iter2 = idom.getAxisIterator(Axis.CHILD);
            DTMAxisIterator iter = new AbsoluteIterator(
                new StepIterator(iter1, iter2));

       iter.setStartNode(DTMDefaultBase.ROOTNODE);
      return iter;
View Full Code Here

Examples of org.apache.xalan.xsltc.dom.SAXImpl

    {
      XSLTCDTMManager dtmManager =
                XSLTCDTMManager.newInstance();
      int dtmPos = dtmManager.getFirstFreeDTMID();
      int documentID = dtmPos << DTMManager.IDENT_DTM_NODE_BITS;
      _dom = (DOM)new SAXImpl(dtmManager, this, documentID, null,
                              null, false, size, true);
      dtmManager.addDTM((DTM)_dom, dtmPos);
    }
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.