/** * Get the EQName form of a name, given its name code or fingerprint * * @param nameCode the integer name code or fingerprint of a name in the name pool * @return the name in the form Q{}local for a name in no namespace, or Q{uri}local for * a name in a namespace */ public String getEQName(int nameCode) { return getUnprefixedQName(nameCode).getEQName(); }
/** * Get the EQName form of a name, given its name code or fingerprint * * @param nameCode the integer name code or fingerprint of a name in the name pool * @return the name in the form Q{}local for a name in no namespace, or Q{uri}local for * a name in a namespace */ public String getEQName(int nameCode) { return getUnprefixedQName(nameCode).getEQName(); }
public String toString() { return classNameToQName(javaClass.getName()).getEQName(); }
public String toString() { return classNameToQName(javaClass.getName()).getEQName(); }
/** * Get the EQName of the variable. This is taken from the variable binding if possible. * The returned name is in the format Q{uri}local if in a namespace, or the local name * alone if not. * * @return the EQName, or the local name if not in a namespace */ public String getEQName() { if (binding != null) { StructuredQName q = binding.getVariableQName(); if (q.hasURI("")) { return q.getLocalPart(); } else { return q.getEQName(); } } else { return variableName.getEQName(); } }
/** * Get the EQName of the variable. This is taken from the variable binding if possible. * The returned name is in the format Q{uri}local if in a namespace, or the local name * alone if not. * * @return the EQName, or the local name if not in a namespace */ public String getEQName() { if (binding != null) { StructuredQName q = binding.getVariableQName(); if (q.hasURI("")) { return q.getLocalPart(); } else { return q.getEQName(); } } else { return variableName.getEQName(); } }
/** * Get the error code associated with the validity error. This is relevant only when validation * is run from within XSLT or XQuery, which define different error codes for validition errors * * @return the error code associated with the error, if any. The error is returned as a simple * string if it is in the standard error namespace, or as an EQName (that is Q{uri}local) otherwise. */ public String getErrorCode() { if (errorCode == null) { return null; } else if (errorCode.hasURI(NamespaceConstant.ERR)) { return errorCode.getLocalPart(); } else { return errorCode.getEQName(); } }
/** * Get the error code associated with the validity error. This is relevant only when validation * is run from within XSLT or XQuery, which define different error codes for validition errors * * @return the error code associated with the error, if any. The error is returned as a simple * string if it is in the standard error namespace, or as an EQName (that is Q{uri}local) otherwise. */ public String getErrorCode() { if (errorCode == null) { return null; } else if (errorCode.hasURI(NamespaceConstant.ERR)) { return errorCode.getLocalPart(); } else { return errorCode.getEQName(); } }
/** * Get the name of the range variable as a Name or EQName. * * @return the name of the range variable. For system allocated * variables, the namespace "http://ns.saxonica.com/anonymous-var" * is used. For names in no namespace, the local name alone is used */ public String getVariableEQName() { if (variableName == null) { return "Q{http://ns.saxonica.com/anonymous-var}var" + computeHashCode(); } else if (variableName.hasURI("")) { return variableName.getLocalPart(); } else { return variableName.getEQName(); } }
/** * Get the name of the range variable as a Name or EQName. * * @return the name of the range variable. For system allocated * variables, the namespace "http://ns.saxonica.com/anonymous-var" * is used. For names in no namespace, the local name alone is used */ public String getVariableEQName() { if (variableName == null) { return "Q{http://ns.saxonica.com/anonymous-var}var" + computeHashCode(); } else if (variableName.hasURI("")) { return variableName.getLocalPart(); } else { return variableName.getEQName(); } }
/** * Evaluate an attribute set * * @param context the dynamic context * @throws XPathException if any failure occurs */ public void expand(XPathContext context) throws XPathException { Stack<AttributeSet> stack = ((XsltController)context.getController()).getAttributeSetEvaluationStack(); if (stack.contains(this)) { throw new XPathException("Attribute set " + getObjectName().getEQName() + " invokes itself recursively", "XTDE0640"); } stack.push(this); getBody().process(context); stack.pop(); if (stack.isEmpty()) { ((XsltController)context.getController()).releaseAttributeSetEvaluationStack(); } }
public String toString() { switch (origin.getNodeKind()) { case Type.ELEMENT: return "element(" + NameOfNode.makeName(origin).getStructuredQName().getEQName() + ")"; case Type.ATTRIBUTE: return "attribute(" + NameOfNode.makeName(origin).getStructuredQName().getEQName() + ")"; case Type.PROCESSING_INSTRUCTION: return "processing-instruction(" + origin.getLocalPart() + ')'; case Type.NAMESPACE: return "namespace-node(" + origin.getLocalPart() + ')'; case Type.COMMENT: return "comment()"; case Type.DOCUMENT: return "document-node()"; case Type.TEXT: return "text()"; default: return "***"; } }
/** * Evaluate an attribute set * * @param context the dynamic context * @throws XPathException if any failure occurs */ public void expand(XPathContext context) throws XPathException { Stack<AttributeSet> stack = ((XsltController)context.getController()).getAttributeSetEvaluationStack(); if (stack.contains(this)) { throw new XPathException("Attribute set " + getObjectName().getEQName() + " invokes itself recursively", "XTDE0640"); } stack.push(this); getBody().process(context); stack.pop(); if (stack.isEmpty()) { ((XsltController)context.getController()).releaseAttributeSetEvaluationStack(); } }
private String makeString(boolean forExport) { if (nodetest1 instanceof NameTest && operator == Token.INTERSECT) { int kind = nodetest1.getPrimitiveType(); String skind = kind == Type.ELEMENT ? "element(" : "attribute("; String content = ""; if (nodetest2 instanceof ContentTypeTest) { SchemaType schemaType = ((ContentTypeTest) nodetest2).getSchemaType(); if (forExport) { schemaType = schemaType.getNearestNamedType(); } content = ", " + schemaType.getEQName(); if (nodetest2.isNillable()) { content += "?"; } } String name = nodetest1.getMatchingNodeName().getEQName(); return skind + name + content + ')'; } else { String nt1 = nodetest1 == null ? "item()" : nodetest1.toString(); String nt2 = nodetest2 == null ? "item()" : nodetest2.toString(); return '(' + nt1 + ' ' + Token.tokens[operator] + ' ' + nt2 + ')'; } }
public String toString() { switch (origin.getNodeKind()) { case Type.ELEMENT: return "element(" + NameOfNode.makeName(origin).getStructuredQName().getEQName() + ")"; case Type.ATTRIBUTE: return "attribute(" + NameOfNode.makeName(origin).getStructuredQName().getEQName() + ")"; case Type.PROCESSING_INSTRUCTION: return "processing-instruction(" + origin.getLocalPart() + ')'; case Type.NAMESPACE: return "namespace-node(" + origin.getLocalPart() + ')'; case Type.COMMENT: return "comment()"; case Type.DOCUMENT: return "document-node()"; case Type.TEXT: return "text()"; default: return "***"; } }
/** * Add the "parameters" of the type to a Dictionary containing the type information * in structured form */ public void addTypeDetails(DictionaryMap map) { if (nodetest1 instanceof NameTest && operator == Token.INTERSECT) { map.initialPut("n", new StringValue(nodetest1.getMatchingNodeName().getEQName())); if (nodetest2 instanceof ContentTypeTest) { SchemaType schemaType = ((ContentTypeTest) nodetest2).getSchemaType(); if (schemaType != Untyped.getInstance() && schemaType != BuiltInAtomicType.UNTYPED_ATOMIC) { map.initialPut("c", new StringValue(schemaType.getEQName() + (nodetest2.isNillable() ? "?" : ""))); } } } }
/** * Diagnostic print of expression structure. The abstract expression tree * is written to the supplied output destination. */ public void export(ExpressionPresenter out) throws XPathException { out.startElement("fnRef"); StructuredQName qName = getFunctionName(); String name = qName.hasURI(NamespaceConstant.FN) ? qName.getLocalPart() : qName.getEQName(); out.emitAttribute("name", name); out.emitAttribute("arity", getArity() + ""); if ((getDetails().properties & BuiltInFunctionSet.DEPENDS_ON_STATIC_CONTEXT) != 0) { out.emitRetainedStaticContext(getRetainedStaticContext(), null); } out.endElement(); }
/** * Diagnostic print of expression structure. The abstract expression tree * is written to the supplied output destination. */ public void export(ExpressionPresenter out) throws XPathException { out.startElement("fnRef"); StructuredQName qName = getFunctionName(); String name = qName.hasURI(NamespaceConstant.FN) ? qName.getLocalPart() : qName.getEQName(); out.emitAttribute("name", name); out.emitAttribute("arity", getArity() + ""); if ((getDetails().properties & BuiltInFunctionSet.DEPENDS_ON_STATIC_CONTEXT) != 0) { out.emitRetainedStaticContext(getRetainedStaticContext(), null); } out.endElement(); }
private void serializeFunction(Function fn) throws XPathException { StructuredQName fname = fn.getFunctionName(); if (fname == null || fname.hasURI(NamespaceConstant.ANONYMOUS)) { emit("(anonymous-function)"); } else if (fname.hasURI(NamespaceConstant.FN)) { emit("fn:" + fname.getLocalPart()); } else if (fname.hasURI(NamespaceConstant.MATH)) { emit("math:" + fname.getLocalPart()); } else if (fname.hasURI(NamespaceConstant.MAP_FUNCTIONS)) { emit("map:" + fname.getLocalPart()); } else if (fname.hasURI(NamespaceConstant.ARRAY_FUNCTIONS)) { emit("array:" + fname.getLocalPart()); } else if (fname.hasURI(NamespaceConstant.SCHEMA)) { emit("xs:" + fname.getLocalPart()); } else { emit(fname.getEQName()); } emit("#" + fn.getArity()); }
private void serializeFunction(Function fn) throws XPathException { StructuredQName fname = fn.getFunctionName(); if (fname == null || fname.hasURI(NamespaceConstant.ANONYMOUS)) { emit("(anonymous-function)"); } else if (fname.hasURI(NamespaceConstant.FN)) { emit("fn:" + fname.getLocalPart()); } else if (fname.hasURI(NamespaceConstant.MATH)) { emit("math:" + fname.getLocalPart()); } else if (fname.hasURI(NamespaceConstant.MAP_FUNCTIONS)) { emit("map:" + fname.getLocalPart()); } else if (fname.hasURI(NamespaceConstant.ARRAY_FUNCTIONS)) { emit("array:" + fname.getLocalPart()); } else if (fname.hasURI(NamespaceConstant.SCHEMA)) { emit("xs:" + fname.getLocalPart()); } else { emit(fname.getEQName()); } emit("#" + fn.getArity()); }