/** * Get the name of the variable * * @return the variable's name */ public StructuredQName getVariableQName() { if (name == null) { try { processVariableName(sourceElement.getAttributeValue("", "name")); } catch (XPathException e) { return errorName(); } } return name; }
/** * Get the name of the variable * * @return the variable's name */ public StructuredQName getVariableQName() { if (name == null) { try { processVariableName(sourceElement.getAttributeValue("", "name")); } catch (XPathException e) { return errorName(); } } return name; }
/** * Process the QName of the variable. Validate the name and place it in the "name" field; * if invalid, construct an error message and place a dummy name in the "name" field for * recovery purposes. * * @param nameAttribute the lexical QName * @throws XPathException if the name is invalid */ private void processVariableName(String nameAttribute) throws XPathException { try { if (nameAttribute != null) { name = sourceElement.makeQName(nameAttribute); } } catch (XPathException err) { name = errorName(); StructuredQName n = StructuredQName.fromClarkName("name"); throw new XPathException("Invalid variable name: " + err.getMessage() + (nameAttribute.startsWith("$") ? " (No '$' sign needed)" : ""), "XTSE0020", new AttributeLocation(sourceElement, n)); } }
/** * Process the QName of the variable. Validate the name and place it in the "name" field; * if invalid, construct an error message and place a dummy name in the "name" field for * recovery purposes. * * @param nameAttribute the lexical QName * @throws XPathException if the name is invalid */ private void processVariableName(String nameAttribute) throws XPathException { try { if (nameAttribute != null) { name = sourceElement.makeQName(nameAttribute); } } catch (XPathException err) { name = errorName(); StructuredQName n = StructuredQName.fromClarkName("name"); throw new XPathException("Invalid variable name: " + err.getMessage() + (nameAttribute.startsWith("$") ? " (No '$' sign needed)" : ""), "XTSE0020", new AttributeLocation(sourceElement, n)); } }