1 57 package com.sun.org.apache.xerces.internal.xinclude; 58 59 import com.sun.org.apache.xerces.internal.xni.NamespaceContext; 60 61 71 public class XIncludeNamespaceSupport extends MultipleScopeNamespaceSupport { 72 73 76 private boolean[] fValidContext = new boolean[8]; 77 78 81 public XIncludeNamespaceSupport() { 82 super(); 83 } 84 85 88 public XIncludeNamespaceSupport(NamespaceContext context) { 89 super(context); 90 } 91 92 95 public void pushContext() { 96 super.pushContext(); 97 if (fCurrentContext + 1 == fValidContext.length) { 98 boolean[] contextarray = new boolean[fValidContext.length * 2]; 99 System.arraycopy(fValidContext, 0, contextarray, 0, fValidContext.length); 100 fValidContext = contextarray; 101 } 102 103 fValidContext[fCurrentContext] = true; 104 } 105 106 113 public void setContextInvalid() { 114 fValidContext[fCurrentContext] = false; 115 } 116 117 126 public String getURIFromIncludeParent(String prefix) { 127 int lastValidContext = fCurrentContext - 1; 128 while (!fValidContext[lastValidContext]) { 129 lastValidContext--; 130 } 131 return getURI(prefix, lastValidContext); 132 } 133 } 134 135 | Popular Tags |