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 (particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler)) current--; continue label;
XSParticleDecl particle2 = (XSParticleDecl)bChildren.elementAt(j); try { particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler); continue label;
XSParticleDecl particle2 = (XSParticleDecl)bChildren.elementAt(j); try { particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler); if (foundIt[j]) throw new XMLSchemaException("rcase-RecurseUnordered.2", null);
current +=1; try { particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler); continue label;
protected void typeSubsumption(XSComplexTypeDecl dType, XSComplexTypeDecl bType, XSGrammarBucket grammarBucket, SubstitutionGroupHandler SGHandler, CMBuilder cmBuilder, XMLErrorReporter errorReporter, SimpleLocator locator) { try { particleValidRestriction(dType.fParticle, SGHandler, bType.fParticle, SGHandler); } catch (XMLSchemaException e) { reportSchemaError(errorReporter, locator, e.getKey(), e.getArgs()); reportSchemaError(errorReporter, locator, "derivation-ok-restriction.5.4.2", new Object[]{dType.fName}); } }
protected void groupSubsumption(XSParticleDecl dParticle, XSParticleDecl bParticle, XSGrammarBucket grammarBucket, SubstitutionGroupHandler SGHandler, CMBuilder cmBuilder, XMLErrorReporter errorReporter, String dName, SimpleLocator locator) { try { particleValidRestriction(dParticle, SGHandler, bParticle, SGHandler); } catch (XMLSchemaException e) { String key = e.getKey(); reportSchemaError(errorReporter, locator, key, e.getArgs()); reportSchemaError(errorReporter, locator, "src-redefine.6.2.2", new Object[]{dName, key}); } }
private boolean particleValidRestriction(XSParticleDecl dParticle, SubstitutionGroupHandler dSGHandler, XSParticleDecl bParticle, SubstitutionGroupHandler bSGHandler, boolean checkWCOccurrence) throws XMLSchemaException { Vector dChildren = null; Vector bChildren = null; int dMinEffectiveTotalRange=OCCURRENCE_UNKNOWN; int dMaxEffectiveTotalRange=OCCURRENCE_UNKNOWN; // By default there has been no expansion boolean bExpansionHappened = false; // Check for empty particles. If either base or derived particle is empty, // (and the other isn't) it's an error. if (dParticle.isEmpty() && !bParticle.emptiable()) { throw new XMLSchemaException("cos-particle-restrict.a", null); } else if (!dParticle.isEmpty() && bParticle.isEmpty()) { throw new XMLSchemaException("cos-particle-restrict.b", null); } // // Do setup prior to invoking the Particle (Restriction) cases. // This involves: // - removing pointless occurrences for groups, and retrieving a vector of // non-pointless children // - turning top-level elements with substitution groups into CHOICE groups.