public void endElement(QName element, XSTypeDefinition type, boolean nillable, Object actualValue, short valueType, ShortList itemValueType) { super.endElement(element, type, nillable, actualValue, valueType, itemValueType); if (fElementDepth-- == fMatchedDepth) { fMatchedDepth = -1; fFieldActivator.endValueScopeFor(fIdentityConstraint, fInitialDepth); } }
handleContent(type, nillable, value, valueType, itemValueType); fMatched[i] = 0;
private void activateSelectorFor(IdentityConstraint ic) { Selector selector = ic.getSelector(); FieldActivator activator = this; if (selector == null) return; XPathMatcher matcher = selector.createMatcher(activator, fElementDepth); if (fSchemaVersion == Constants.SCHEMA_VERSION_1_1) { matcher.setXPathDefaultNamespace(selector.getXPathDefaultNamespace()); } fMatcherStack.addMatcher(matcher); matcher.startDocumentFragment(); }
System.out.println(toString()+" [CHILD] before"); if (!matches(nodeTest, element)) { if (fCurrentStep[i] > descendantStep) { fCurrentStep[i] = descendantStep; if (matches(nodeTest, fQName)) { fCurrentStep[i]++; if (fCurrentStep[i] == steps.length) { AttributePSVI attrPSVI = (AttributePSVI)attributes.getAugmentations(aIndex).getItem(Constants.ATTRIBUTE_PSVI); fMatchedString = attrPSVI.getActualNormalizedValue(); matched(fMatchedString, attrPSVI.getActualNormalizedValueType(), attrPSVI.getItemValueTypes(), false);
/** * The start of an element. If the document specifies the start element * by using an empty tag, then the startElement method will immediately * be followed by the endElement method, with no intervening methods. * * @param element The name of the element. * @param attributes The element attributes. * */ public void startElement(QName element, XMLAttributes attributes) { super.startElement(element, attributes); fElementDepth++; // activate the fields, if selector is matched //int matched = isMatched(); if (isMatched()) { /* (fMatchedDepth == -1 && ((matched & MATCHED) == MATCHED)) || ((matched & MATCHED_DESCENDANT) == MATCHED_DESCENDANT)) { */ fMatchedDepth = fElementDepth; fFieldActivator.startValueScopeFor(fIdentityConstraint, fInitialDepth); int count = fIdentityConstraint.getFieldCount(); for (int i = 0; i < count; i++) { Field field = fIdentityConstraint.getFieldAt(i); XPathMatcher matcher = fFieldActivator.activateField(field, fInitialDepth); matcher.startElement(element, attributes); } } } // startElement(QName,XMLAttrList,int)
public void startDocumentFragment(){ super.startDocumentFragment(); fElementDepth = 0; fMatchedDepth = -1; } // startDocumentFragment()
/** * This method is called when the XPath handler matches the * XPath expression. */ protected void matched(Object actualValue, short valueType, ShortList itemValueType, boolean isNil) { super.matched(actualValue, valueType, itemValueType, isNil); if(isNil && (fIdentityConstraint.getCategory() == IdentityConstraint.IC_KEY)) { String code = "KeyMatchesNillable"; fStore.reportError(code, new Object[]{fStore.getElementName(), fIdentityConstraint.getIdentityConstraintName()}); } fStore.addValue(Field.this, fMayMatch, actualValue, convertToPrimitiveKind(valueType), convertToPrimitiveKind(itemValueType)); // once we've stored the value for this field, we set the mayMatch // member to false so that in the same scope, we don't match any more // values (and throw an error instead). fMayMatch = false; } // matched(String)
for (int i = 0; i < count; i++) { XPathMatcher matcher = fMatcherStack.getMatcherAt(i); matcher.startElement( element, attributes);
/** * Request to activate the specified field. This method returns the * matcher for the field. * * @param field The field to activate. */ public XPathMatcher activateField(Field field, int initialDepth) { ValueStore valueStore = fValueStoreCache.getValueStoreFor(field.getIdentityConstraint(), initialDepth); XPathMatcher matcher = field.createMatcher(valueStore); if (fSchemaVersion == Constants.SCHEMA_VERSION_1_1) { matcher.setXPathDefaultNamespace(field.getXPathDefaultNamespace()); } fMatcherStack.addMatcher(matcher); matcher.startDocumentFragment(); return matcher; } // activateField(Field):XPathMatcher
XPathMatcher matcher = fMatcherStack.getMatcherAt(i); if (fCurrentElemDecl == null) { matcher.endElement(element, fCurrentType, false, fValidatedInfo.actualValue, fValidatedInfo.actualValueType, fValidatedInfo.itemValueTypes); matcher.endElement( element, fCurrentType,