public void startElement(int nameCode, int typeCode, int locationId, int properties) throws XPathException {
if (level == 0) {
if (++count == 1) {
// don't bother with any caching on the first item, it will often be the only one
ItemType type = new CombinedNodeTest(
new NameTest(Type.ELEMENT, nameCode, getNamePool()),
Token.INTERSECT,
new ContentTypeTest(Type.ELEMENT, getConfiguration().getSchemaType(typeCode), getConfiguration()));
checkItemType(type, locationId);
} else {
if (count == 2) {
checkAllowsMany(locationId);
}
Long key = new Long(((long)(nameCode&NamePool.FP_MASK))<<32 | (long)(typeCode&NamePool.FP_MASK));
if (!checkedElements.contains(key)) {
ItemType type = new CombinedNodeTest(
new NameTest(Type.ELEMENT, nameCode, getNamePool()),
Token.INTERSECT,
new ContentTypeTest(Type.ELEMENT, getConfiguration().getSchemaType(typeCode), getConfiguration()));
checkItemType(type, locationId);
checkedElements.add(key);