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)
| 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. |