1 57 58 package com.sun.org.apache.xerces.internal.dom; 59 60 import com.sun.org.apache.xerces.internal.impl.xs.XSImplementationImpl; 61 import org.w3c.dom.DOMImplementationList ; 62 import org.w3c.dom.DOMImplementation ; 63 import java.util.Vector ; 64 65 72 public class DOMXSImplementationSourceImpl 73 extends DOMImplementationSourceImpl { 74 75 84 public DOMImplementation getDOMImplementation(String features) { 85 DOMImplementation impl = super.getDOMImplementation(features); 86 if (impl != null){ 87 return impl; 88 } 89 impl = PSVIDOMImplementationImpl.getDOMImplementation(); 91 if (testImpl(impl, features)) { 92 return impl; 93 } 94 impl = XSImplementationImpl.getDOMImplementation(); 96 if (testImpl(impl, features)) { 97 return impl; 98 } 99 100 return null; 101 } 102 103 114 public DOMImplementationList getDOMImplementationList(String features) { 115 final Vector implementations = new Vector (); 116 117 DOMImplementationList list = super.getDOMImplementationList(features); 119 for (int i=0; i < list.getLength(); i++ ) { 121 implementations.addElement(list.item(i)); 122 } 123 124 DOMImplementation impl = PSVIDOMImplementationImpl.getDOMImplementation(); 125 if (testImpl(impl, features)) { 126 implementations.addElement(impl); 127 } 128 129 impl = XSImplementationImpl.getDOMImplementation(); 130 if (testImpl(impl, features)) { 131 implementations.addElement(impl); 132 } 133 return new DOMImplementationListImpl(implementations); 134 } 135 } 136 | Popular Tags |