contextItemType = match.getNodeTest();
}
if (match != null) {
int slots = match.allocateSlots(getStaticContext(), getSlotManager(), 0);
RuleManager mgr = getPrincipalStylesheet().getRuleManager();
for (int i=0; i<modeNames.length; i++) {
StructuredQName nc = modeNames[i];
Mode mode = mgr.getMode(nc, true);
if (prioritySpecified) {
mgr.setHandler(match, compiledTemplate, mode, getPrecedence(), priority);
} else {
mgr.setHandler(match, compiledTemplate, mode, getPrecedence());
}
mode.allocatePatternSlots(slots);
if (mode.isStreamable()) {
compiledTemplate.setStreamable(true);
}