if (areSame(wildcard, otherWildcard)) { unionWildcard.fType = wildcard.fType; unionWildcard.fNamespaceList = wildcard.fNamespaceList; unionWildcard.fNamespaceList = union2sets(wildcard.fNamespaceList, otherWildcard.fNamespaceList); boolean foundAbsent = elementInSet(XSWildcardDecl.ABSENT, list); boolean foundNS = elementInSet(local[0], list); if (foundNS && foundAbsent) { unionWildcard.fType = XSWildcardDecl.NSCONSTRAINT_ANY;
private void checkNSRecurseCheckCardinality(Vector children, int min1, int max1, SubstitutionGroupHandler dSGHandler, XSParticleDecl wildcard, int min2, int max2, boolean checkWCOccurrence) throws XMLSchemaException { // check Occurrence ranges if (checkWCOccurrence && !checkOccurrenceRange(min1,max1,min2,max2)) { throw new XMLSchemaException("rcase-NSRecurseCheckCardinality.2", new Object[]{ Integer.toString(min1), max1==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max1), Integer.toString(min2), max2==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max2)}); } // Check that each member of the group is a valid restriction of the wildcard int count = children.size(); try { for (int i = 0; i < count; i++) { XSParticleDecl particle1 = (XSParticleDecl)children.elementAt(i); particleValidRestriction(particle1, dSGHandler, wildcard, null, false); } } // REVISIT: should we really just ignore original cause of this error? // how can we report it? catch (XMLSchemaException e) { throw new XMLSchemaException("rcase-NSRecurseCheckCardinality.1", null); } }
if (areSame(wildcard, otherWildcard)) { intersectWildcard.fType = wildcard.fType; intersectWildcard.fNamespaceList = wildcard.fNamespaceList; intersectWildcard.fNamespaceList = intersect2sets(wildcard.fNamespaceList, otherWildcard.fNamespaceList);
XSParticleDecl dtmp = getNonUnaryGroup(dParticle); if (dtmp != dParticle) { dChildren = removePointlessChildren(dParticle); addElementToParticleVector(dChildren, subGroup[i]); addElementToParticleVector(dChildren, dElement); Collections.sort(dChildren, ELEMENT_PARTICLE_COMPARATOR); XSParticleDecl btmp = getNonUnaryGroup(bParticle); if (btmp != bParticle) { bChildren = removePointlessChildren(bParticle); addElementToParticleVector(bChildren, bsubGroup[i]); addElementToParticleVector(bChildren, bElement); Collections.sort(bChildren, ELEMENT_PARTICLE_COMPARATOR); checkNameAndTypeOK((XSElementDecl)dParticle.fValue,dMinOccurs,dMaxOccurs, (XSElementDecl)bParticle.fValue,bMinOccurs,bMaxOccurs); return bExpansionHappened; checkNSCompat((XSElementDecl)dParticle.fValue,dMinOccurs,dMaxOccurs, (XSWildcardDecl)bParticle.fValue,bMinOccurs,bMaxOccurs, checkWCOccurrence); checkRecurseLax(dChildren, 1, 1, dSGHandler,
if (!checkOccurrenceRange(dMin, dMax, bMin, bMax)) { throw new XMLSchemaException("rcase-NameAndTypeOK.3", new Object[]{ checkIDConstraintRestriction(dElement, bElement); if (!checkTypeDerivationOk(dElement.fType, bElement.fType, (short)(XSConstants.DERIVATION_EXTENSION|XSConstants.DERIVATION_LIST|XSConstants.DERIVATION_UNION))) { throw new XMLSchemaException("rcase-NameAndTypeOK.7",
private void checkNSSubset(XSWildcardDecl dWildcard, int min1, int max1, XSWildcardDecl bWildcard, int min2, int max2) throws XMLSchemaException { // check Occurrence ranges if (!checkOccurrenceRange(min1,max1,min2,max2)) { throw new XMLSchemaException("rcase-NSSubset.2", new Object[]{ Integer.toString(min1), max1==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max1), Integer.toString(min2), max2==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max2)}); } // check wildcard subset if (!isSubsetOf(dWildcard, bWildcard)) { throw new XMLSchemaException("rcase-NSSubset.1", null); } if (dWildcard.weakerProcessContents(bWildcard)) { throw new XMLSchemaException("rcase-NSSubset.3", new Object[]{dWildcard.getProcessContentsAsString(), bWildcard.getProcessContentsAsString()}); } }
private void checkNSCompat(XSElementDecl elem, int min1, int max1, XSWildcardDecl wildcard, int min2, int max2, boolean checkWCOccurrence) throws XMLSchemaException { // check Occurrence ranges if (checkWCOccurrence && !checkOccurrenceRange(min1,max1,min2,max2)) { throw new XMLSchemaException("rcase-NSCompat.2", new Object[]{ elem.fName, Integer.toString(min1), max1==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max1), Integer.toString(min2), max2==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max2)}); } // check wildcard allows namespace of element if (!wildcard.allowNamespace(elem.fTargetNamespace)) { throw new XMLSchemaException("rcase-NSCompat.1", new Object[]{elem.fName,elem.fTargetNamespace}); } }
static final XSConstraints XS_1_0_CONSTRAINTS = new XS10Constraints(Constants.SCHEMA_VERSION_1_0); static final XSConstraints XS_1_0_CONSTRAINTS_EXTENDED = new XS10Constraints(Constants.SCHEMA_VERSION_1_0_EXTENDED); static final XSConstraints XS_1_1_CONSTRAINTS = new XS11Constraints();
if (!checkOccurrenceRange(min1,max1,min2,max2)) { throw new XMLSchemaException("rcase-RecurseLax.1", new Object[]{ Integer.toString(min1), if (particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler)) current--; continue label;
if (!checkOccurrenceRange(min1,max1,min2,max2)) { throw new XMLSchemaException("rcase-MapAndSum.2", new Object[]{Integer.toString(min1), XSParticleDecl particle2 = (XSParticleDecl)bChildren.elementAt(j); try { particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler); continue label;
if (!checkOccurrenceRange(min1,max1,min2,max2)) { throw new XMLSchemaException("rcase-RecurseUnordered.1", new Object[]{ Integer.toString(min1), XSParticleDecl particle2 = (XSParticleDecl)bChildren.elementAt(j); try { particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler); if (foundIt[j]) throw new XMLSchemaException("rcase-RecurseUnordered.2", null);
if (!checkOccurrenceRange(min1,max1,min2,max2)) { throw new XMLSchemaException("rcase-Recurse.1", new Object[]{ Integer.toString(min1), current +=1; try { particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler); continue label;