1 16 17 package org.apache.xerces.dom; 18 19 import org.apache.xerces.impl.xs.XSImplementationImpl; 20 import org.w3c.dom.DOMImplementationList ; 21 import org.w3c.dom.DOMImplementation ; 22 import java.util.Vector ; 23 24 34 public class DOMXSImplementationSourceImpl 35 extends DOMImplementationSourceImpl { 36 37 46 public DOMImplementation getDOMImplementation(String features) { 47 DOMImplementation impl = super.getDOMImplementation(features); 48 if (impl != null){ 49 return impl; 50 } 51 impl = PSVIDOMImplementationImpl.getDOMImplementation(); 53 if (testImpl(impl, features)) { 54 return impl; 55 } 56 impl = XSImplementationImpl.getDOMImplementation(); 58 if (testImpl(impl, features)) { 59 return impl; 60 } 61 62 return null; 63 } 64 65 76 public DOMImplementationList getDOMImplementationList(String features) { 77 final Vector implementations = new Vector (); 78 79 DOMImplementationList list = super.getDOMImplementationList(features); 81 for (int i=0; i < list.getLength(); i++ ) { 83 implementations.addElement(list.item(i)); 84 } 85 86 DOMImplementation impl = PSVIDOMImplementationImpl.getDOMImplementation(); 87 if (testImpl(impl, features)) { 88 implementations.addElement(impl); 89 } 90 91 impl = XSImplementationImpl.getDOMImplementation(); 92 if (testImpl(impl, features)) { 93 implementations.addElement(impl); 94 } 95 return new DOMImplementationListImpl(implementations); 96 } 97 } 98 | Popular Tags |