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

Method qname

basex-core/src/main/java/org/basex/query/expr/constr/CName.java:58–70  ·  view source on GitHub ↗

Evaluates the name expression as a QName. @param elem element construction @param qc query context @return result @throws QueryException query exception

(final boolean elem, final QueryContext qc)

Source from the content-addressed store, hash-verified

56 * @throws QueryException query exception
57 */
58 final QNm qname(final boolean elem, final QueryContext qc) throws QueryException {
59 final Item item = name.atomItem(qc, info);
60 final Type type = item.type;
61 if(type == BasicType.QNAME) return (QNm) item;
62
63 if(!type.isStringOrUntyped() || type == BasicType.ANY_URI)
64 throw STRQNM_X_X.get(info, item.seqType(), item);
65
66 final QNm qnm = qc.shared.parseQName(item.string(info), elem, qc, sc());
67 if(qnm != null) return qnm;
68
69 throw INVQNAME_X.get(info, item);
70 }
71
72 /**
73 * Evaluates the name expression as an NCName.

Callers 8

matchesMethod · 0.45
elementsMethod · 0.45
addMethod · 0.45
optimizeMethod · 0.45
itemMethod · 0.45
optimizeMethod · 0.45
itemMethod · 0.45
matchesMethod · 0.45

Calls 7

isStringOrUntypedMethod · 0.95
seqTypeMethod · 0.95
stringMethod · 0.95
parseQNameMethod · 0.80
getMethod · 0.65
atomItemMethod · 0.45
scMethod · 0.45

Tested by 1

matchesMethod · 0.36