1 28 29 package com.caucho.xpath; 30 31 public class NamespaceContext { 32 private NamespaceContext prev; 33 private String prefix; 34 private String url; 35 36 public NamespaceContext(NamespaceContext prev, String prefix, String url) 37 { 38 this.prev = prev; 39 this.prefix = prefix.intern(); 40 this.url = url.intern(); 41 } 42 43 public NamespaceContext getPrev() 44 { 45 return prev; 46 } 47 48 public String getPrefix() 49 { 50 return prefix; 51 } 52 53 public String getUrl() 54 { 55 return url; 56 } 57 58 public static String find(NamespaceContext ns, String prefix) 59 { 60 for (; ns != null; ns = ns.prev) { 61 if (ns.prefix.equals(prefix)) 62 return ns.url; 63 } 64 65 return null; 66 } 67 } 68 | Popular Tags |