private boolean allowName(String ns, String name) { // Check namespace first if (!allowNS(ns)) { return false; } // Whether the name is in the disallowed list for (int i = 0; i < wDNList.size(); i+=2) { if (ns == wDNList.get(i) && name == wDNList.get(i+1)) { return false; } } // Whether the name is in the allowed list for (int i = 0; i < wANList.size(); i+=2) { if (ns == wANList.get(i) && name == wANList.get(i+1)) { return true; } } // Additional ##sibling and ##defined checks qname.uri = ns; qname.localpart = name; return derived.allowExpandedName(wd, qname, sgh, this); }
private void addAN(String ns, String name) { // Only add if it's allowed by the current wildcard if (!allowNS(ns)) { return; } // Only add if the name is not in the disallowed name list. for (int i = 0; i < wDNList.size();) { if (wDNList.get(i++) == ns && wDNList.get(i++) == name) { return; } } // Only add if the name is allowed by the wildcard in terms of // ##sibling and ##defined. qname.uri = ns; qname.localpart = name; if (!derived.allowExpandedName(wd, qname, sgh, this)) { return; } // The name is allowed, add it. wANList.add(ns); wANList.add(name); }
qname.uri = (String)wANList.get(i++); qname.localpart = (String)wANList.get(i++); if (base.allowExpandedName(wb, qname, sgh, this)) { return true;
if (!base.allowExpandedName(wc, qname, sgh, this)) { return false;
private boolean findElementInBase() { // for all edges in the base that leaves the base state // check whether it's an edge matching the base edge. // if it is, return the next state. indexb[0] = -1; while ((eb = base.nextElementTransition(b, bn, indexb)) != null) { // Base element edge, check whether it matches the derived element if (matchElementWithBaseElement()) { // If name matches, check type, nil, fixed etc. return checkEERestriction(); } } // No matching element edge, try wildcards. indexb[0] = -1; while ((wb = base.nextWildcardTransition(b, bn, indexb)) != null) { // Base wildcard edge, check whether it matches the derived element qname.uri = ed.fTargetNamespace; qname.localpart = ed.fName; if (base.allowExpandedName(wb, qname, sgh, this)) { // If name matches, check whether there is a matching global. return checkEWRestriction(); } } return false; }