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

Method checkNS

basex-core/src/main/java/org/basex/query/up/expr/Update.java:45–56  ·  view source on GitHub ↗

Checks for namespace conflicts in attributes. @param list node list @param target target node @return specified node list @throws QueryException query exception

(final GNodeList list, final XNode target)

Source from the content-addressed store, hash-verified

43 * @throws QueryException query exception
44 */
45 final GNodeList checkNS(final GNodeList list, final XNode target) throws QueryException {
46 for(final GNode node : list) {
47 final QNm name = node.qname();
48 final byte[] prefix = name.prefix();
49 // attributes without prefix have no namespace
50 if(prefix.length == 0) continue;
51 // check if attribute and target have the same namespace
52 final byte[] uri = target.uri(prefix);
53 if(uri != null && !eq(name.uri(), uri)) throw UPNSCONFL_X_X.get(info, name.uri(), uri);
54 }
55 return list;
56 }
57
58 /**
59 * Creates a node builder.

Callers 2

itemMethod · 0.80
itemMethod · 0.80

Calls 6

prefixMethod · 0.95
uriMethod · 0.95
eqMethod · 0.65
getMethod · 0.65
qnameMethod · 0.45
uriMethod · 0.45

Tested by

no test coverage detected