Examples of DOM


Examples of org.apache.xalan.xsltc.DOM

     * @return one of <code>NOTSTRIP</code>, <code>STRIP</code> or
     * <code>INHERIT</code>.
     */
    public short getShouldStripSpace(int node, DTM dtm) {
        if (m_filter != null && dtm instanceof DOM) {
            DOM dom = (DOM)dtm;
            int type = 0;

            if (dtm instanceof DOMEnhancedForDTM) {
                DOMEnhancedForDTM mappableDOM = (DOMEnhancedForDTM)dtm;
               
View Full Code Here

Examples of org.apache.xalan.xsltc.DOM

    /**
     * Builds an internal DOM from a TrAX Source object
     */
    private DOM getDOM(Source source) throws TransformerException {
        try {
            DOM dom = null;

            if (source != null) {
                DTMWSFilter wsfilter;
                if (_translet != null && _translet instanceof StripFilter) {
                    wsfilter = new DOMWSFilter(_translet);
View Full Code Here

Examples of org.apache.xalan.xsltc.DOM

            }
        } else if (source instanceof DOMSource) {
            final DOMSource domsrc = (DOMSource) source;
            new DOM2TO(domsrc.getNode(), handler).parse();
        } else if (source instanceof XSLTCSource) {
            final DOM dom = ((XSLTCSource) source).getDOM(null, _translet);
            ((SAXImpl)dom).copy(handler);
        } else {
            ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR);
            throw new TransformerException(err.toString());
        }
View Full Code Here

Examples of org.apache.xalan.xsltc.DOM

      }
     
  }

  // Get the references to the actual DOM and DTD handler
  final DOM dom = doc.getDocument();

  // The dom reference may be null if the URL pointed to a
  // non-existing document
  if (dom == null) return null;
View Full Code Here

Examples of org.apache.xalan.xsltc.DOM

        return addDOMAdapter(adapter, true);
    }

    private int addDOMAdapter(DOMAdapter adapter, boolean indexByURI) {
        // Add the DOM adapter to the array of DOMs
        DOM dom = adapter.getDOMImpl();
       
        int domNo = 1;
        int dtmSize = 1;
        SuballocatedIntVector dtmIds = null;
        if (dom instanceof DTMDefaultBase) {
            DTMDefaultBase dtmdb = (DTMDefaultBase)dom;
            dtmIds = dtmdb.getDTMIDs();
            dtmSize = dtmIds.size();
            domNo = dtmIds.elementAt(dtmSize-1) >>> DTMManager.IDENT_DTM_NODE_BITS;
        }
        else if (dom instanceof SimpleResultTreeImpl) {
            SimpleResultTreeImpl simpleRTF = (SimpleResultTreeImpl)dom;
            domNo = simpleRTF.getDocument() >>> DTMManager.IDENT_DTM_NODE_BITS;
        }
                 
        if (domNo >= _size) {
            int oldSize = _size;
            do {
              _size *= 2;
            } while (_size <= domNo);
           
            final DOMAdapter[] newArray = new DOMAdapter[_size];
            System.arraycopy(_adapters, 0, newArray, 0, oldSize);
            _adapters = newArray;
        }
       
        _free = domNo + 1;
       
        if (dtmSize == 1) {
            _adapters[domNo] = adapter;
        }
        else if (dtmIds != null) {
            int domPos = 0;
            for (int i = dtmSize - 1; i >= 0; i++) {
                domPos = dtmIds.elementAt(i) >>> DTMManager.IDENT_DTM_NODE_BITS;
                _adapters[domPos] = adapter;
            }
            domNo = domPos;
        }

        // Store reference to document (URI) in hashtable
        if (indexByURI) {
            String uri = adapter.getDocumentURI(0);
            _documents.put(uri, new Integer(domNo));
        }
       
        // If the dom is an AdaptiveResultTreeImpl, we need to create a
        // DOMAdapter around its nested dom object (if it is non-null) and
        // add the DOMAdapter to the list.
        if (dom instanceof AdaptiveResultTreeImpl) {
            AdaptiveResultTreeImpl adaptiveRTF = (AdaptiveResultTreeImpl)dom;
            DOM nestedDom = adaptiveRTF.getNestedDOM();
            if (nestedDom != null) {
                DOMAdapter newAdapter = new DOMAdapter(nestedDom,
                                                       adapter.getNamesArray(),
                                                       adapter.getNamespaceArray());
                addDOMAdapter(newAdapter)
View Full Code Here

Examples of org.apache.xalan.xsltc.DOM

     * Builds an internal DOM from a TrAX Source object
     */
    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 {
View Full Code Here

Examples of org.apache.xalan.xsltc.DOM

  else if (source instanceof DOMSource) {
      final DOMSource domsrc = (DOMSource) source;
      new DOM2TO(domsrc.getNode(), handler).parse();
  }
  else if (source instanceof XSLTCSource) {
      final DOM dom = ((XSLTCSource) source).getDOM();
      ((SAXImpl)dom).copy(handler);
  }
  else {
      ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR);
      throw new TransformerException(err.toString());
View Full Code Here

Examples of org.apache.xalan.xsltc.DOM

     * Implements the nodeset() extension function.
     */
    public static DTMAxisIterator nodesetF(Object obj) {
  if (obj instanceof DOM) {
     //final DOMAdapter adapter = (DOMAdapter) obj;
     final DOM dom = (DOM)obj;
     return new SingletonIterator(dom.getDocument(), true);
  }
        else if (obj instanceof DTMAxisIterator) {
     return (DTMAxisIterator) obj;
        }
        else {
View Full Code Here

Examples of org.apache.xalan.xsltc.DOM

      else if (obj instanceof Node) {
    dom.copy(((Node) obj).node, handler);
      }
      else if (obj instanceof DOM) {
    //((DOM)obj).copy(((org.apache.xml.dtm.ref.DTMDefaultBase)((DOMAdapter)obj).getDOMImpl()).getDocument(), handler);
    DOM newDom = (DOM)obj;
    newDom.copy(newDom.getDocument(), handler);
      }
      else {
    String string = obj.toString();    // or call stringF()
    final int length = string.length();
    if (length > _characterArray.length)
View Full Code Here

Examples of org.apache.xalan.xsltc.DOM

        }
   
        // Check if this DOM has already been added to the multiplexer
        int mask = multiplexer.getDocumentMask(uri);
        if (mask != -1) {
            DOM newDom = ((DOMAdapter)multiplexer.getDOMAdapter(uri))
                                       .getDOMImpl();
            if (newDom instanceof SAXImpl) {
                return new SingletonIterator(((SAXImpl)newDom).getDocument(),
                                             true);
            }
        }

        // Check if we can get the DOM from a DOMCache
        DOMCache cache = translet.getDOMCache();
        DOM newdom;

        mask = multiplexer.nextMask(); // peek

        if (cache != null) {
            //newdom = cache.retrieveDocument(originalUri, mask, translet);
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.