Java Code Examples for com.sun.org.apache.xalan.internal.xsltc.DOM#getDocument()

The following examples show how to use com.sun.org.apache.xalan.internal.xsltc.DOM#getDocument() . 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: BasisLibrary.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * 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 {
        final String className = obj.getClass().getName();
        runTimeError(DATA_CONVERSION_ERR, "node-set", className);
        return null;
    }
}
 
Example 2
Source File: BasisLibrary.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * 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 {
        final String className = obj.getClass().getName();
        runTimeError(DATA_CONVERSION_ERR, "node-set", className);
        return null;
    }
}
 
Example 3
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 4
Source File: LoadDocument.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Create a DTMAxisIterator for the newdom. This is currently only
 * used to create an iterator for the cached stylesheet DOM.
 *
 * @param newdom the cached stylesheet DOM
 * @param translet the translet
 * @param the main dom (should be a MultiDOM)
 * @return a DTMAxisIterator from the document root
 */
private static DTMAxisIterator document(DOM newdom,
                                        AbstractTranslet translet,
                                        DOM dom)
    throws Exception
{
    DTMManager dtmManager = ((MultiDOM)dom).getDTMManager();
    // Need to migrate the cached DTM to the new DTMManager
    if (dtmManager != null && newdom instanceof DTM) {
        ((DTM)newdom).migrateTo(dtmManager);
    }

    translet.prepassDocument(newdom);

    // Wrap the DOM object in a DOM adapter and add to multiplexer
    final DOMAdapter domAdapter = translet.makeDOMAdapter(newdom);
    ((MultiDOM)dom).addDOMAdapter(domAdapter);

    // Create index for any key elements
    translet.buildKeys(domAdapter, null, null,
                       newdom.getDocument());

    // Return a singleton iterator containing the root node
    return new SingletonIterator(newdom.getDocument(), true);
}
 
Example 5
Source File: BasisLibrary.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 {
        final String className = obj.getClass().getName();
        runTimeError(DATA_CONVERSION_ERR, "node-set", className);
        return null;
    }
}
 
Example 6
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 7
Source File: LoadDocument.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a DTMAxisIterator for the newdom. This is currently only
 * used to create an iterator for the cached stylesheet DOM.
 *
 * @param newdom the cached stylesheet DOM
 * @param translet the translet
 * @param the main dom (should be a MultiDOM)
 * @return a DTMAxisIterator from the document root
 */
private static DTMAxisIterator document(DOM newdom,
                                        AbstractTranslet translet,
                                        DOM dom)
    throws Exception
{
    DTMManager dtmManager = ((MultiDOM)dom).getDTMManager();
    // Need to migrate the cached DTM to the new DTMManager
    if (dtmManager != null && newdom instanceof DTM) {
        ((DTM)newdom).migrateTo(dtmManager);
    }

    translet.prepassDocument(newdom);

    // Wrap the DOM object in a DOM adapter and add to multiplexer
    final DOMAdapter domAdapter = translet.makeDOMAdapter(newdom);
    ((MultiDOM)dom).addDOMAdapter(domAdapter);

    // Create index for any key elements
    translet.buildKeys(domAdapter, null, null,
                       newdom.getDocument());

    // Return a singleton iterator containing the root node
    return new SingletonIterator(newdom.getDocument(), true);
}
 
Example 8
Source File: BasisLibrary.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 {
        final String className = obj.getClass().getName();
        runTimeError(DATA_CONVERSION_ERR, "node-set", className);
        return null;
    }
}
 
Example 9
Source File: BasisLibrary.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 {
        final String className = obj.getClass().getName();
        runTimeError(DATA_CONVERSION_ERR, "node-set", className);
        return null;
    }
}
 
Example 10
Source File: LoadDocument.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a DTMAxisIterator for the newdom. This is currently only
 * used to create an iterator for the cached stylesheet DOM.
 *
 * @param newdom the cached stylesheet DOM
 * @param translet the translet
 * @param the main dom (should be a MultiDOM)
 * @return a DTMAxisIterator from the document root
 */
private static DTMAxisIterator document(DOM newdom,
                                        AbstractTranslet translet,
                                        DOM dom)
    throws Exception
{
    DTMManager dtmManager = ((MultiDOM)dom).getDTMManager();
    // Need to migrate the cached DTM to the new DTMManager
    if (dtmManager != null && newdom instanceof DTM) {
        ((DTM)newdom).migrateTo(dtmManager);
    }

    translet.prepassDocument(newdom);

    // Wrap the DOM object in a DOM adapter and add to multiplexer
    final DOMAdapter domAdapter = translet.makeDOMAdapter(newdom);
    ((MultiDOM)dom).addDOMAdapter(domAdapter);

    // Create index for any key elements
    translet.buildKeys(domAdapter, null, null,
                       newdom.getDocument());

    // Return a singleton iterator containing the root node
    return new SingletonIterator(newdom.getDocument(), true);
}
 
Example 11
Source File: BasisLibrary.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 {
        final String className = obj.getClass().getName();
        runTimeError(DATA_CONVERSION_ERR, "node-set", className);
        return null;
    }
}
 
Example 12
Source File: MultiDOM.java    From JDKSourceCode1.8 with MIT License 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 13
Source File: LoadDocument.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Create a DTMAxisIterator for the newdom. This is currently only
 * used to create an iterator for the cached stylesheet DOM.
 *
 * @param newdom the cached stylesheet DOM
 * @param translet the translet
 * @param the main dom (should be a MultiDOM)
 * @return a DTMAxisIterator from the document root
 */
private static DTMAxisIterator document(DOM newdom,
                                        AbstractTranslet translet,
                                        DOM dom)
    throws Exception
{
    DTMManager dtmManager = ((MultiDOM)dom).getDTMManager();
    // Need to migrate the cached DTM to the new DTMManager
    if (dtmManager != null && newdom instanceof DTM) {
        ((DTM)newdom).migrateTo(dtmManager);
    }

    translet.prepassDocument(newdom);

    // Wrap the DOM object in a DOM adapter and add to multiplexer
    final DOMAdapter domAdapter = translet.makeDOMAdapter(newdom);
    ((MultiDOM)dom).addDOMAdapter(domAdapter);

    // Create index for any key elements
    translet.buildKeys(domAdapter, null, null,
                       newdom.getDocument());

    // Return a singleton iterator containing the root node
    return new SingletonIterator(newdom.getDocument(), true);
}
 
Example 14
Source File: BasisLibrary.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 {
        final String className = obj.getClass().getName();
        runTimeError(DATA_CONVERSION_ERR, "node-set", className);
        return null;
    }
}
 
Example 15
Source File: LoadDocument.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a DTMAxisIterator for the newdom. This is currently only
 * used to create an iterator for the cached stylesheet DOM.
 *
 * @param newdom the cached stylesheet DOM
 * @param translet the translet
 * @param the main dom (should be a MultiDOM)
 * @return a DTMAxisIterator from the document root
 */
private static DTMAxisIterator document(DOM newdom,
                                        AbstractTranslet translet,
                                        DOM dom)
    throws Exception
{
    DTMManager dtmManager = ((MultiDOM)dom).getDTMManager();
    // Need to migrate the cached DTM to the new DTMManager
    if (dtmManager != null && newdom instanceof DTM) {
        ((DTM)newdom).migrateTo(dtmManager);
    }

    translet.prepassDocument(newdom);

    // Wrap the DOM object in a DOM adapter and add to multiplexer
    final DOMAdapter domAdapter = translet.makeDOMAdapter(newdom);
    ((MultiDOM)dom).addDOMAdapter(domAdapter);

    // Create index for any key elements
    translet.buildKeys(domAdapter, null, null,
                       newdom.getDocument());

    // Return a singleton iterator containing the root node
    return new SingletonIterator(newdom.getDocument(), true);
}
 
Example 16
Source File: BasisLibrary.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 {
        final String className = obj.getClass().getName();
        runTimeError(DATA_CONVERSION_ERR, "node-set", className);
        return null;
    }
}
 
Example 17
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 18
Source File: MultiDOM.java    From openjdk-jdk9 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: LoadDocument.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a DTMAxisIterator for the newdom. This is currently only
 * used to create an iterator for the cached stylesheet DOM.
 *
 * @param newdom the cached stylesheet DOM
 * @param translet the translet
 * @param the main dom (should be a MultiDOM)
 * @return a DTMAxisIterator from the document root
 */
private static DTMAxisIterator document(DOM newdom,
                                        AbstractTranslet translet,
                                        DOM dom)
    throws Exception
{
    DTMManager dtmManager = ((MultiDOM)dom).getDTMManager();
    // Need to migrate the cached DTM to the new DTMManager
    if (dtmManager != null && newdom instanceof DTM) {
        ((DTM)newdom).migrateTo(dtmManager);
    }

    translet.prepassDocument(newdom);

    // Wrap the DOM object in a DOM adapter and add to multiplexer
    final DOMAdapter domAdapter = translet.makeDOMAdapter(newdom);
    ((MultiDOM)dom).addDOMAdapter(domAdapter);

    // Create index for any key elements
    translet.buildKeys(domAdapter, null, null,
                       newdom.getDocument());

    // Return a singleton iterator containing the root node
    return new SingletonIterator(newdom.getDocument(), true);
}
 
Example 20
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;
                }
            }
        }
    }
}