FileDocCategorySizeDatePackage
DOMXSImplementationSourceImpl.javaAPI DocApache Xerces 3.0.14147Fri Sep 14 20:33:54 BST 2007org.apache.xerces.dom

DOMXSImplementationSourceImpl

public class DOMXSImplementationSourceImpl extends DOMImplementationSourceImpl
Allows to retrieve XSImplementation, DOM Level 3 Core and LS implementations and PSVI implementation.

See also the Document Object Model (DOM) Level 3 Core Specification.

xerces.internal
author
Elena Litani, IBM
version
$Id: DOMXSImplementationSourceImpl.java 447266 2006-09-18 05:57:49Z mrglavas $

Fields Summary
Constructors Summary
Methods Summary
public org.w3c.dom.DOMImplementationgetDOMImplementation(java.lang.String features)
A method to request a DOM implementation.

param
features A string that specifies which features are required. This is a space separated list in which each feature is specified by its name optionally followed by a space and a version number. This is something like: "XML 1.0 Traversal Events 2.0"
return
An implementation that has the desired features, or null if this source has none.

        DOMImplementation impl = super.getDOMImplementation(features);
        if (impl != null){
            return impl;
        }
        // if not try the PSVIDOMImplementation
        impl = PSVIDOMImplementationImpl.getDOMImplementation();
        if (testImpl(impl, features)) {
            return impl;
        }
        // if not try the XSImplementation
        impl = XSImplementationImpl.getDOMImplementation();
        if (testImpl(impl, features)) {
            return impl;
        }
        
        return null;
    
public org.w3c.dom.DOMImplementationListgetDOMImplementationList(java.lang.String features)
A method to request a list of DOM implementations that support the specified features and versions, as specified in .

param
features A string that specifies which features and versions are required. This is a space separated list in which each feature is specified by its name optionally followed by a space and a version number. This is something like: "XML 3.0 Traversal +Events 2.0"
return
A list of DOM implementations that support the desired features.

        final Vector implementations = new Vector();
        
        // first check whether the CoreDOMImplementation would do
        DOMImplementationList list = super.getDOMImplementationList(features);
        //Add core DOMImplementations
        for (int i=0; i < list.getLength(); i++ ) {
            implementations.addElement(list.item(i));
        }
        
        DOMImplementation impl = PSVIDOMImplementationImpl.getDOMImplementation();
        if (testImpl(impl, features)) {
            implementations.addElement(impl);
        }
        
        impl = XSImplementationImpl.getDOMImplementation();
        if (testImpl(impl, features)) {
            implementations.addElement(impl);
        }
        return new DOMImplementationListImpl(implementations);