MCPcopy Create free account
hub / github.com/BaseXdb/basex / nsScope

Method nsScope

basex-core/src/main/java/org/basex/query/value/node/XNode.java:291–304  ·  view source on GitHub ↗

Returns a copy of the namespace hierarchy. @param qc query context (can be null) @return namespaces

(final QueryContext qc)

Source from the content-addressed store, hash-verified

289 * @return namespaces
290 */
291 public final Atts nsScope(final QueryContext qc) {
292 final Atts ns = new Atts();
293 for(XNode node = this; node != null; node = node.parent()) {
294 final Atts nsp = node.namespaces();
295 if(nsp != null) {
296 for(int a = nsp.size() - 1; a >= 0; a--) {
297 final byte[] name = nsp.name(a);
298 if(!ns.contains(name)) ns.add(name, nsp.value(a));
299 }
300 }
301 }
302 if(qc != null) qc.ns.inScope(ns);
303 return ns;
304 }
305
306 /**
307 * Recursively finds the URI for the specified prefix.

Callers 7

itemMethod · 0.95
deepEqualMethod · 0.95
itemMethod · 0.95
cdataSectionElementsMethod · 0.45
valueMethod · 0.45
itemMethod · 0.45
addElemMethod · 0.45

Calls 8

parentMethod · 0.95
namespacesMethod · 0.95
sizeMethod · 0.95
nameMethod · 0.95
containsMethod · 0.95
addMethod · 0.95
valueMethod · 0.95
inScopeMethod · 0.80

Tested by

no test coverage detected