com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase Java Examples

The following examples show how to use com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SAXImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set start to END should 'close' the iterator,
 * i.e. subsequent call to next() should return END.
 *
 * @param node Sets the root of the iteration.
 *
 * @return A DTMAxisIterator set to the start of the iteration.
 */
public DTMAxisIterator setStartNode(int node) {
    //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
    if (node == DTMDefaultBase.ROOTNODE) {
        node = getDocument();
    }

    if (_isRestartable) {
        _startNode = node;
        _currentNode = (node == DTM.NULL) ? DTM.NULL : NOTPROCESSED;

        return resetPosition();
    }

    return this;
}
 
Example #2
Source File: SAXImpl.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Set start to END should 'close' the iterator,
 * i.e. subsequent call to next() should return END.
 *
 * @param node Sets the root of the iteration.
 *
 * @return A DTMAxisIterator set to the start of the iteration.
 */
public DTMAxisIterator setStartNode(int node) {
    //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
    if (node == DTMDefaultBase.ROOTNODE) {
        node = getDocument();
    }

    if (_isRestartable) {
        int nsType = _nsType;

        _startNode = node;

        for (node = getFirstAttribute(node);
             node != END;
             node = getNextAttribute(node)) {
            if (getNSType(node) == nsType) {
                break;
            }
        }

        _currentNode = node;
        return resetPosition();
    }

    return this;
}
 
Example #3
Source File: SAXImpl.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Set start to END should 'close' the iterator,
 * i.e. subsequent call to next() should return END.
 *
 * @param node Sets the root of the iteration.
 *
 * @return A DTMAxisIterator set to the start of the iteration.
 */
public DTMAxisIterator setStartNode(int node) {
    //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
    if (node == DTMDefaultBase.ROOTNODE) {
        node = getDocument();
    }

    if (_isRestartable) {
        _startNode = node;
        _currentNode = (node == DTM.NULL) ? DTM.NULL : NOTPROCESSED;

        return resetPosition();
    }

    return this;
}
 
Example #4
Source File: SAXImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set start to END should 'close' the iterator,
 * i.e. subsequent call to next() should return END.
 *
 * @param node Sets the root of the iteration.
 *
 * @return A DTMAxisIterator set to the start of the iteration.
 */
public DTMAxisIterator setStartNode(int node) {
    //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
    if (node == DTMDefaultBase.ROOTNODE) {
        node = getDocument();
    }

    if (_isRestartable) {
        int nsType = _nsType;

        _startNode = node;

        for (node = getFirstAttribute(node);
             node != END;
             node = getNextAttribute(node)) {
            if (getNSType(node) == nsType) {
                break;
            }
        }

        _currentNode = node;
        return resetPosition();
    }

    return this;
}
 
Example #5
Source File: SAXImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set start to END should 'close' the iterator,
 * i.e. subsequent call to next() should return END.
 *
 * @param node Sets the root of the iteration.
 *
 * @return A DTMAxisIterator set to the start of the iteration.
 */
public DTMAxisIterator setStartNode(int node) {
    //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
    if (node == DTMDefaultBase.ROOTNODE) {
        node = getDocument();
    }

    if (_isRestartable) {
        _startNode = node;
        _currentNode = (node == DTM.NULL) ? DTM.NULL : NOTPROCESSED;

        return resetPosition();
    }

    return this;
}
 
Example #6
Source File: SAXImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Set start to END should 'close' the iterator,
 * i.e. subsequent call to next() should return END.
 *
 * @param node Sets the root of the iteration.
 *
 * @return A DTMAxisIterator set to the start of the iteration.
 */
public DTMAxisIterator setStartNode(int node) {
    //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
    if (node == DTMDefaultBase.ROOTNODE) {
        node = getDocument();
    }

    if (_isRestartable) {
        int nsType = _nsType;

        _startNode = node;

        for (node = getFirstAttribute(node);
             node != END;
             node = getNextAttribute(node)) {
            if (getNSType(node) == nsType) {
                break;
            }
        }

        _currentNode = node;
        return resetPosition();
    }

    return this;
}
 
Example #7
Source File: MultiDOM.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
public void removeDOMAdapter(DOMAdapter adapter) {
    _documents.remove(adapter.getDocumentURI(0));
    DOM dom = adapter.getDOMImpl();

    if (dom instanceof DTMDefaultBase) {
        SuballocatedIntVector ids = ((DTMDefaultBase) dom).getDTMIDs();
        int idsSize = ids.size();
        for (int i = 0; i < idsSize; i++) {
            _adapters[ids.elementAt(i) >>> DTMManager.IDENT_DTM_NODE_BITS] = null;
        }
    } else {
        int id = dom.getDocument() >>> DTMManager.IDENT_DTM_NODE_BITS;
        if ((id > 0) && (id < _adapters.length) && isMatchingAdapterEntry(_adapters[id], adapter)) {
            _adapters[id] = null;
        } else {
            boolean found = false;
            for (int i = 0; i < _adapters.length; i++) {
                if (isMatchingAdapterEntry(_adapters[id], adapter)) {
                    _adapters[i] = null;
                    found = true;
                    break;
                }
            }
        }
    }
}
 
Example #8
Source File: SAX2DTM2.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Setting start to END should 'close' the iterator,
 * i.e. subsequent call to next() should return END.
 * <p>
 * If the iterator is not restartable, this has no effect.
 * %REVIEW% Should it return/throw something in that case,
 * or set current node to END, to indicate request-not-honored?
 *
 * @param node Sets the root of the iteration.
 *
 * @return A DTMAxisIterator set to the start of the iteration.
 */
public DTMAxisIterator setStartNode(int node)
{
  //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
  if (node == DTMDefaultBase.ROOTNODE)
    node = getDocument();
  if (_isRestartable) {
    _startNode = node;
    _currentNode = (node == DTM.NULL) ? DTM.NULL
                                      : _firstch2(makeNodeIdentity(node));

    return resetPosition();
  }

  return this;
}
 
Example #9
Source File: MultiDOM.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void removeDOMAdapter(DOMAdapter adapter) {
    _documents.remove(adapter.getDocumentURI(0));
    DOM dom = adapter.getDOMImpl();

    if (dom instanceof DTMDefaultBase) {
        SuballocatedIntVector ids = ((DTMDefaultBase) dom).getDTMIDs();
        int idsSize = ids.size();
        for (int i = 0; i < idsSize; i++) {
            _adapters[ids.elementAt(i) >>> DTMManager.IDENT_DTM_NODE_BITS] = null;
        }
    } else {
        int id = dom.getDocument() >>> DTMManager.IDENT_DTM_NODE_BITS;
        if ((id > 0) && (id < _adapters.length) && isMatchingAdapterEntry(_adapters[id], adapter)) {
            _adapters[id] = null;
        } else {
            boolean found = false;
            for (int i = 0; i < _adapters.length; i++) {
                if (isMatchingAdapterEntry(_adapters[id], adapter)) {
                    _adapters[i] = null;
                    found = true;
                    break;
                }
            }
        }
    }
}
 
Example #10
Source File: SAXImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set start to END should 'close' the iterator,
 * i.e. subsequent call to next() should return END.
 *
 * @param node Sets the root of the iteration.
 *
 * @return A DTMAxisIterator set to the start of the iteration.
 */
public DTMAxisIterator setStartNode(int node) {
    //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
    if (node == DTMDefaultBase.ROOTNODE) {
        node = getDocument();
    }

    if (_isRestartable) {
        _startNode = node;
        _currentNode = (node == DTM.NULL) ? DTM.NULL : NOTPROCESSED;

        return resetPosition();
    }

    return this;
}
 
Example #11
Source File: SAX2DTM2.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
     * Set start to END should 'close' the iterator,
     * i.e. subsequent call to next() should return END.
     *
     * @param node Sets the root of the iteration.
     *
     * @return A DTMAxisIterator set to the start of the iteration.
     */
    public DTMAxisIterator setStartNode(int node)
    {
//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
      if (node == DTMDefaultBase.ROOTNODE)
        node = getDocument();
      if (_isRestartable)
      {
        node = makeNodeIdentity(node);
        _startNode = node;

        if (_includeSelf)
          node--;

        _currentNode = node;

        return resetPosition();
      }

      return this;
    }
 
Example #12
Source File: SAXImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set start to END should 'close' the iterator,
 * i.e. subsequent call to next() should return END.
 *
 * @param node Sets the root of the iteration.
 *
 * @return A DTMAxisIterator set to the start of the iteration.
 */
public DTMAxisIterator setStartNode(int node) {
    //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
    if (node == DTMDefaultBase.ROOTNODE) {
        node = getDocument();
    }

    if (_isRestartable) {
        int nsType = _nsType;

        _startNode = node;

        for (node = getFirstAttribute(node);
             node != END;
             node = getNextAttribute(node)) {
            if (getNSType(node) == nsType) {
                break;
            }
        }

        _currentNode = node;
        return resetPosition();
    }

    return this;
}
 
Example #13
Source File: SAXImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set start to END should 'close' the iterator,
 * i.e. subsequent call to next() should return END.
 *
 * @param node Sets the root of the iteration.
 *
 * @return A DTMAxisIterator set to the start of the iteration.
 */
public DTMAxisIterator setStartNode(int node) {
    //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
    if (node == DTMDefaultBase.ROOTNODE) {
        node = getDocument();
    }

    if (_isRestartable) {
        int nsType = _nsType;

        _startNode = node;

        for (node = getFirstAttribute(node);
             node != END;
             node = getNextAttribute(node)) {
            if (getNSType(node) == nsType) {
                break;
            }
        }

        _currentNode = node;
        return resetPosition();
    }

    return this;
}
 
Example #14
Source File: MultiDOM.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void removeDOMAdapter(DOMAdapter adapter) {
    _documents.remove(adapter.getDocumentURI(0));
    DOM dom = adapter.getDOMImpl();

    if (dom instanceof DTMDefaultBase) {
        SuballocatedIntVector ids = ((DTMDefaultBase) dom).getDTMIDs();
        int idsSize = ids.size();
        for (int i = 0; i < idsSize; i++) {
            _adapters[ids.elementAt(i) >>> DTMManager.IDENT_DTM_NODE_BITS] = null;
        }
    } else {
        int id = dom.getDocument() >>> DTMManager.IDENT_DTM_NODE_BITS;
        if ((id > 0) && (id < _adapters.length) && isMatchingAdapterEntry(_adapters[id], adapter)) {
            _adapters[id] = null;
        } else {
            boolean found = false;
            for (int i = 0; i < _adapters.length; i++) {
                if (isMatchingAdapterEntry(_adapters[id], adapter)) {
                    _adapters[i] = null;
                    found = true;
                    break;
                }
            }
        }
    }
}
 
Example #15
Source File: SAX2DTM2.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
     * Set start to END should 'close' the iterator,
     * i.e. subsequent call to next() should return END.
     *
     * @param node Sets the root of the iteration.
     *
     * @return A DTMAxisIterator set to the start of the iteration.
     */
    public DTMAxisIterator setStartNode(int node)
    {
//%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
      if (node == DTMDefaultBase.ROOTNODE)
        node = getDocument();
      if (_isRestartable)
      {
        node = makeNodeIdentity(node);
        _startNode = node;

        if (_includeSelf)
          node--;

        _currentNode = node;

        return resetPosition();
      }

      return this;
    }
 
Example #16
Source File: SAXImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Set start to END should 'close' the iterator,
 * i.e. subsequent call to next() should return END.
 *
 * @param node Sets the root of the iteration.
 *
 * @return A DTMAxisIterator set to the start of the iteration.
 */
public DTMAxisIterator setStartNode(int node) {
    //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
    if (node == DTMDefaultBase.ROOTNODE) {
        node = getDocument();
    }

    if (_isRestartable) {
        _startNode = node;
        _currentNode = (node == DTM.NULL) ? DTM.NULL : NOTPROCESSED;

        return resetPosition();
    }

    return this;
}
 
Example #17
Source File: MultiDOM.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
public void removeDOMAdapter(DOMAdapter adapter) {
    _documents.remove(adapter.getDocumentURI(0));
    DOM dom = adapter.getDOMImpl();

    if (dom instanceof DTMDefaultBase) {
        SuballocatedIntVector ids = ((DTMDefaultBase) dom).getDTMIDs();
        int idsSize = ids.size();
        for (int i = 0; i < idsSize; i++) {
            _adapters[ids.elementAt(i) >>> DTMManager.IDENT_DTM_NODE_BITS] = null;
        }
    } else {
        int id = dom.getDocument() >>> DTMManager.IDENT_DTM_NODE_BITS;
        if ((id > 0) && (id < _adapters.length) && isMatchingAdapterEntry(_adapters[id], adapter)) {
            _adapters[id] = null;
        } else {
            boolean found = false;
            for (int i = 0; i < _adapters.length; i++) {
                if (isMatchingAdapterEntry(_adapters[id], adapter)) {
                    _adapters[i] = null;
                    found = true;
                    break;
                }
            }
        }
    }
}
 
Example #18
Source File: MultiDOM.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void removeDOMAdapter(DOMAdapter adapter) {
    _documents.remove(adapter.getDocumentURI(0));
    DOM dom = adapter.getDOMImpl();

    if (dom instanceof DTMDefaultBase) {
        SuballocatedIntVector ids = ((DTMDefaultBase) dom).getDTMIDs();
        int idsSize = ids.size();
        for (int i = 0; i < idsSize; i++) {
            _adapters[ids.elementAt(i) >>> DTMManager.IDENT_DTM_NODE_BITS] = null;
        }
    } else {
        int id = dom.getDocument() >>> DTMManager.IDENT_DTM_NODE_BITS;
        if ((id > 0) && (id < _adapters.length) && isMatchingAdapterEntry(_adapters[id], adapter)) {
            _adapters[id] = null;
        } else {
            boolean found = false;
            for (int i = 0; i < _adapters.length; i++) {
                if (isMatchingAdapterEntry(_adapters[id], adapter)) {
                    _adapters[i] = null;
                    found = true;
                    break;
                }
            }
        }
    }
}
 
Example #19
Source File: SAXImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set start to END should 'close' the iterator,
 * i.e. subsequent call to next() should return END.
 *
 * @param node Sets the root of the iteration.
 *
 * @return A DTMAxisIterator set to the start of the iteration.
 */
public DTMAxisIterator setStartNode(int node) {
    //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
    if (node == DTMDefaultBase.ROOTNODE) {
        node = getDocument();
    }

    if (_isRestartable) {
        _startNode = node;
        _currentNode = (node == DTM.NULL) ? DTM.NULL : NOTPROCESSED;

        return resetPosition();
    }

    return this;
}
 
Example #20
Source File: SAXImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set start to END should 'close' the iterator,
 * i.e. subsequent call to next() should return END.
 *
 * @param node Sets the root of the iteration.
 *
 * @return A DTMAxisIterator set to the start of the iteration.
 */
public DTMAxisIterator setStartNode(int node) {
    //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
    if (node == DTMDefaultBase.ROOTNODE) {
        node = getDocument();
    }

    if (_isRestartable) {
        _startNode = node;
        _currentNode = (node == DTM.NULL) ? DTM.NULL : NOTPROCESSED;

        return resetPosition();
    }

    return this;
}
 
Example #21
Source File: SAXImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set start to END should 'close' the iterator,
 * i.e. subsequent call to next() should return END.
 *
 * @param node Sets the root of the iteration.
 *
 * @return A DTMAxisIterator set to the start of the iteration.
 */
public DTMAxisIterator setStartNode(int node) {
    //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
    if (node == DTMDefaultBase.ROOTNODE) {
        node = getDocument();
    }

    if (_isRestartable) {
        int nsType = _nsType;

        _startNode = node;

        for (node = getFirstAttribute(node);
             node != END;
             node = getNextAttribute(node)) {
            if (getNSType(node) == nsType) {
                break;
            }
        }

        _currentNode = node;
        return resetPosition();
    }

    return this;
}
 
Example #22
Source File: SAXImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Set start to END should 'close' the iterator,
 * i.e. subsequent call to next() should return END.
 *
 * @param node Sets the root of the iteration.
 *
 * @return A DTMAxisIterator set to the start of the iteration.
 */
public DTMAxisIterator setStartNode(int node) {
    //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
    if (node == DTMDefaultBase.ROOTNODE) {
        node = getDocument();
    }

    if (_isRestartable) {
        _startNode = node;
        _currentNode = (node == DTM.NULL) ? DTM.NULL : NOTPROCESSED;

        return resetPosition();
    }

    return this;
}
 
Example #23
Source File: SAXImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set start to END should 'close' the iterator,
 * i.e. subsequent call to next() should return END.
 *
 * @param node Sets the root of the iteration.
 *
 * @return A DTMAxisIterator set to the start of the iteration.
 */
public DTMAxisIterator setStartNode(int node) {
    //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily
    if (node == DTMDefaultBase.ROOTNODE) {
        node = getDocument();
    }

    if (_isRestartable) {
        int nsType = _nsType;

        _startNode = node;

        for (node = getFirstAttribute(node);
             node != END;
             node = getNextAttribute(node)) {
            if (getNSType(node) == nsType) {
                break;
            }
        }

        _currentNode = node;
        return resetPosition();
    }

    return this;
}
 
Example #24
Source File: SAXImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct a SAXImpl object using the given block size.
 */
public SAXImpl(XSLTCDTMManager mgr, Source source,
               int dtmIdentity, DTMWSFilter whiteSpaceFilter,
               XMLStringFactory xstringfactory,
               boolean doIndexing, int blocksize,
               boolean buildIdIndex,
               boolean newNameTable)
{
    super(mgr, source, dtmIdentity, whiteSpaceFilter, xstringfactory,
        doIndexing, blocksize, false, buildIdIndex, newNameTable);

    _dtmManager = mgr;
    _size = blocksize;

    // Use a smaller size for the space stack if the blocksize is small
    _xmlSpaceStack = new int[blocksize <= 64 ? 4 : 64];

    /* From DOMBuilder */
    _xmlSpaceStack[0] = DTMDefaultBase.ROOTNODE;

    // If the input source is DOMSource, set the _document field and
    // create the node2Ids table.
    if (source instanceof DOMSource) {
        _hasDOMSource = true;
        DOMSource domsrc = (DOMSource)source;
        Node node = domsrc.getNode();
        if (node instanceof Document) {
            _document = (Document)node;
        }
        else {
            _document = node.getOwnerDocument();
        }
        _node2Ids = new HashMap<>();
    }
}
 
Example #25
Source File: MultiDOM.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
public MultiDOM(DOM main) {
    _size = INITIAL_SIZE;
    _free = 1;
    _adapters = new DOM[INITIAL_SIZE];
    DOMAdapter adapter = (DOMAdapter)main;
    _adapters[0] = adapter;
    _main = adapter;
    DOM dom = adapter.getDOMImpl();
    if (dom instanceof DTMDefaultBase) {
        _dtmManager = ((DTMDefaultBase)dom).getManager();
    }

    // %HZ% %REVISIT% Is this the right thing to do here?  In the old
    // %HZ% %REVISIT% version, the main document did not get added through
    // %HZ% %REVISIT% a call to addDOMAdapter, which meant it couldn't be
    // %HZ% %REVISIT% found by a call to getDocumentMask.  The problem is
    // %HZ% %REVISIT% TransformerHandler is typically constructed with a
    // %HZ% %REVISIT% system ID equal to the stylesheet's URI; with SAX
    // %HZ% %REVISIT% input, it ends up giving that URI to the document.
    // %HZ% %REVISIT% Then, any references to document('') are resolved
    // %HZ% %REVISIT% using the stylesheet's URI.
    // %HZ% %REVISIT% MultiDOM.getDocumentMask is called to verify that
    // %HZ% %REVISIT% a document associated with that URI has not been
    // %HZ% %REVISIT% encountered, and that method ends up returning the
    // %HZ% %REVISIT% mask of the main document, when what we really what
    // %HZ% %REVISIT% is to read the stylesheet itself!
    addDOMAdapter(adapter, false);
}
 
Example #26
Source File: MultiDOM.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public MultiDOM(DOM main) {
    _size = INITIAL_SIZE;
    _free = 1;
    _adapters = new DOM[INITIAL_SIZE];
    DOMAdapter adapter = (DOMAdapter)main;
    _adapters[0] = adapter;
    _main = adapter;
    DOM dom = adapter.getDOMImpl();
    if (dom instanceof DTMDefaultBase) {
        _dtmManager = ((DTMDefaultBase)dom).getManager();
    }

    // %HZ% %REVISIT% Is this the right thing to do here?  In the old
    // %HZ% %REVISIT% version, the main document did not get added through
    // %HZ% %REVISIT% a call to addDOMAdapter, which meant it couldn't be
    // %HZ% %REVISIT% found by a call to getDocumentMask.  The problem is
    // %HZ% %REVISIT% TransformerHandler is typically constructed with a
    // %HZ% %REVISIT% system ID equal to the stylesheet's URI; with SAX
    // %HZ% %REVISIT% input, it ends up giving that URI to the document.
    // %HZ% %REVISIT% Then, any references to document('') are resolved
    // %HZ% %REVISIT% using the stylesheet's URI.
    // %HZ% %REVISIT% MultiDOM.getDocumentMask is called to verify that
    // %HZ% %REVISIT% a document associated with that URI has not been
    // %HZ% %REVISIT% encountered, and that method ends up returning the
    // %HZ% %REVISIT% mask of the main document, when what we really what
    // %HZ% %REVISIT% is to read the stylesheet itself!
    addDOMAdapter(adapter, false);
}
 
Example #27
Source File: AbsoluteIterator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public DTMAxisIterator setStartNode(int node) {
    _startNode = DTMDefaultBase.ROOTNODE;
    if (_isRestartable) {
        _source.setStartNode(_startNode);
        resetPosition();
    }
    return this;
}
 
Example #28
Source File: DupFilterIterator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Set the start node for this iterator
 * @param node The start node
 * @return A reference to this node iterator
 */
public DTMAxisIterator setStartNode(int node) {
    if (_isRestartable) {
        // KeyIndex iterators are always relative to the root node, so there
        // is never any point in re-reading the iterator (and we SHOULD NOT).
        boolean sourceIsKeyIndex = _source instanceof KeyIndex;

        if (sourceIsKeyIndex
                && _startNode == DTMDefaultBase.ROOTNODE) {
            return this;
        }

        if (node != _startNode) {
            _source.setStartNode(_startNode = node);

            _nodes.clear();
            while ((node = _source.next()) != END) {
                _nodes.add(node);
            }

            // Nodes produced by KeyIndex are known to be in document order.
            // Take advantage of it.
            if (!sourceIsKeyIndex) {
                _nodes.sort();
            }
            _nodesSize = _nodes.cardinality();
            _current = 0;
            _lastNext = END;
            resetPosition();
        }
    }
    return this;
}
 
Example #29
Source File: DupFilterIterator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public DupFilterIterator(DTMAxisIterator source) {
        _source = source;
// System.out.println("DFI source = " + source + " this = " + this);

        // Cache contents of id() or key() index right away. Necessary for
        // union expressions containing multiple calls to the same index, and
        // correct as well since start-node is irrelevant for id()/key() exrp.
        if (source instanceof KeyIndex) {
            setStartNode(DTMDefaultBase.ROOTNODE);
        }
    }
 
Example #30
Source File: MultiDOM.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public MultiDOM(DOM main) {
    _size = INITIAL_SIZE;
    _free = 1;
    _adapters = new DOM[INITIAL_SIZE];
    DOMAdapter adapter = (DOMAdapter)main;
    _adapters[0] = adapter;
    _main = adapter;
    DOM dom = adapter.getDOMImpl();
    if (dom instanceof DTMDefaultBase) {
        _dtmManager = ((DTMDefaultBase)dom).getManager();
    }

    // %HZ% %REVISIT% Is this the right thing to do here?  In the old
    // %HZ% %REVISIT% version, the main document did not get added through
    // %HZ% %REVISIT% a call to addDOMAdapter, which meant it couldn't be
    // %HZ% %REVISIT% found by a call to getDocumentMask.  The problem is
    // %HZ% %REVISIT% TransformerHandler is typically constructed with a
    // %HZ% %REVISIT% system ID equal to the stylesheet's URI; with SAX
    // %HZ% %REVISIT% input, it ends up giving that URI to the document.
    // %HZ% %REVISIT% Then, any references to document('') are resolved
    // %HZ% %REVISIT% using the stylesheet's URI.
    // %HZ% %REVISIT% MultiDOM.getDocumentMask is called to verify that
    // %HZ% %REVISIT% a document associated with that URI has not been
    // %HZ% %REVISIT% encountered, and that method ends up returning the
    // %HZ% %REVISIT% mask of the main document, when what we really what
    // %HZ% %REVISIT% is to read the stylesheet itself!
    addDOMAdapter(adapter, false);
}