* @throws SaxonApiException if the requiredType is syntactically invalid or if it refers to namespace
* prefixes or schema components that are not present in the static context
*/
public void declareVariable(QName qname, ItemType itemType, OccurrenceIndicator occurrences) throws SaxonApiException {
XPathVariable var = env.declareVariable(qname.getNamespaceURI(), qname.getLocalName());
var.setRequiredType(
SequenceType.makeSequenceType(
itemType.getUnderlyingItemType(), occurrences.getCardinality()));
declaredVariables.add(var);
}