}
int newCount = fMatcherStack.getMatcherCount();
// handle everything *but* keyref's.
for (int i = oldCount - 1; i >= newCount; i--) {
XPathMatcher matcher = fMatcherStack.getMatcherAt(i);
IdentityConstraint id;
if((id = matcher.getIDConstraint()) != null && id.getType() != IdentityConstraint.KEYREF) {
if (DEBUG_IDENTITY_CONSTRAINTS) {
System.out.println("<IC>: "+matcher+"#endDocumentFragment()");
}
matcher.endDocumentFragment();
fValueStoreCache.transplant(id);
} else if (id == null)
matcher.endDocumentFragment();
}
// now handle keyref's/...
for (int i = oldCount - 1; i >= newCount; i--) {
XPathMatcher matcher = fMatcherStack.getMatcherAt(i);
IdentityConstraint id;
if((id = matcher.getIDConstraint()) != null && id.getType() == IdentityConstraint.KEYREF) {
if (DEBUG_IDENTITY_CONSTRAINTS) {
System.out.println("<IC>: "+matcher+"#endDocumentFragment()");
}
ValueStoreBase values = fValueStoreCache.getValueStoreFor(id);
if(values != null) // nothing to do if nothing matched!