FileDocCategorySizeDatePackage
DOMXSImplementationSourceImpl.javaAPI DocJava SE 6 API3918Tue Jun 10 00:22:36 BST 2008com.sun.org.apache.xerces.internal.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,v 1.2.6.1 2005/08/31 10:14:26 sunithareddy Exp $

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);