1 package net.sf.saxon.instruct; 2 import net.sf.saxon.om.NamespaceConstant; 3 import net.sf.saxon.om.NamespaceResolver; 4 5 import java.io.Serializable ; 6 import java.util.ArrayList ; 7 import java.util.Iterator ; 8 import java.util.List ; 9 10 16 17 public final class DummyNamespaceResolver implements Serializable , NamespaceResolver { 18 19 private static DummyNamespaceResolver theInstance = new DummyNamespaceResolver(); 20 21 25 26 public static DummyNamespaceResolver getInstance() { 27 return theInstance; 28 } 29 30 private DummyNamespaceResolver() {}; 31 32 33 40 41 public String getURIForPrefix(String prefix, boolean useDefault) { 42 if ("".equals(prefix)) { 43 return ""; 44 } else if ("xml".equals(prefix)) { 45 return NamespaceConstant.XML; 46 } else { 47 return ""; 49 } 50 } 51 52 56 57 public Iterator iteratePrefixes() { 58 List list = new ArrayList (2); 59 list.add(""); 60 list.add("xml"); 61 return list.iterator(); 62 } 63 } 64 65 | Popular Tags |