1 16 package org.apache.xerces.xinclude; 17 18 import org.apache.xerces.xni.NamespaceContext; 19 20 30 public class XIncludeNamespaceSupport extends MultipleScopeNamespaceSupport { 31 32 35 private boolean[] fValidContext = new boolean[8]; 36 37 40 public XIncludeNamespaceSupport() { 41 super(); 42 } 43 44 47 public XIncludeNamespaceSupport(NamespaceContext context) { 48 super(context); 49 } 50 51 54 public void pushContext() { 55 super.pushContext(); 56 if (fCurrentContext + 1 == fValidContext.length) { 57 boolean[] contextarray = new boolean[fValidContext.length * 2]; 58 System.arraycopy(fValidContext, 0, contextarray, 0, fValidContext.length); 59 fValidContext = contextarray; 60 } 61 62 fValidContext[fCurrentContext] = true; 63 } 64 65 72 public void setContextInvalid() { 73 fValidContext[fCurrentContext] = false; 74 } 75 76 85 public String getURIFromIncludeParent(String prefix) { 86 int lastValidContext = fCurrentContext - 1; 87 while (lastValidContext > 0 && !fValidContext[lastValidContext]) { 88 lastValidContext--; 89 } 90 return getURI(prefix, lastValidContext); 91 } 92 } | Popular Tags |