public void findElemInTable(XSComplexTypeDecl type, XSElementDecl elem, SymbolHash elemDeclHash) throws XMLSchemaException { final XSElementDecl existingElem = findExistingElement(elem, elemDeclHash); // First time or is same element if (existingElem == null || existingElem == elem) { return; } if (elem.fType != existingElem.fType) { // Types are not the same throw new XMLSchemaException("cos-element-consistent", new Object[] {type.fName, elem.fName}); } }
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}); } }
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); } }
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()}); } }
throw new XMLSchemaException("rcase-RecurseUnordered.1", new Object[]{ Integer.toString(min1), max1==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max1), particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler); if (foundIt[j]) throw new XMLSchemaException("rcase-RecurseUnordered.2", null); else foundIt[j]=true; throw new XMLSchemaException("rcase-RecurseUnordered.2", null); XSParticleDecl particle2 = (XSParticleDecl)bChildren.elementAt(j); if (!foundIt[j] && !particle2.emptiable()) { throw new XMLSchemaException("rcase-RecurseUnordered.2", null);
throw new XMLSchemaException("rcase-RecurseLax.1", new Object[]{ Integer.toString(min1), max1==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max1), throw new XMLSchemaException("rcase-RecurseLax.2", null);
throw new XMLSchemaException("rcase-Recurse.1", new Object[]{ Integer.toString(min1), max1==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max1), throw new XMLSchemaException("rcase-Recurse.2", null); throw new XMLSchemaException("rcase-Recurse.2", null); XSParticleDecl particle2 = (XSParticleDecl)bChildren.elementAt(j); if (!particle2.emptiable()) { throw new XMLSchemaException("rcase-Recurse.2", null);
throw new XMLSchemaException("rcase-MapAndSum.2", new Object[]{Integer.toString(min1), max1==SchemaSymbols.OCCURRENCE_UNBOUNDED?"unbounded":Integer.toString(max1), throw new XMLSchemaException("rcase-MapAndSum.1", null);
throw new XMLSchemaException("cos-nonambig", new Object[]{ i < fNumElements ? (Object)fElements[i] : (Object)fWildcards[i], j < fNumElements ? (Object)fElements[j] : (Object)fWildcards[j]});
final public void findElemInTable(XSComplexTypeDecl type, XSElementDecl elem, SymbolHash elemDeclHash) throws XMLSchemaException { final XSElementDecl existingElem = findExistingElement(elem, elemDeclHash); // First time or is same element if (existingElem == null || existingElem == elem) { return; } if (elem.fType != existingElem.fType) { // Types are not the same throw new XMLSchemaException("cos-element-consistent", new Object[] {type.fName, elem.fName}); } if (XS11TypeHelper.isTypeTablesComparable(elem.getTypeAlternatives(), existingElem.getTypeAlternatives()) && !isTypeTablesEquivalent(elem, existingElem)) { // Type tables are not equivalent throw new XMLSchemaException("cos-element-consistent.4.b", new Object[] {type.fName, elem.fName}); } }
throw new XMLSchemaException( "rcase-NameAndTypeOK.1",new Object[]{dElement.fName, dElement.fTargetNamespace, bElement.fName, bElement.fTargetNamespace}); throw new XMLSchemaException("rcase-NameAndTypeOK.2", new Object[]{dElement.fName}); throw new XMLSchemaException("rcase-NameAndTypeOK.3", new Object[]{ dElement.fName, throw new XMLSchemaException("rcase-NameAndTypeOK.4.a", new Object[]{dElement.fName, bElement.fDefault.stringValue()}); throw new XMLSchemaException("rcase-NameAndTypeOK.4.b", new Object[]{dElement.fName, dElement.fDefault.stringValue(), if (((blockSet1 & blockSet2)!=blockSet2) || (blockSet1==XSConstants.DERIVATION_NONE && blockSet2!=XSConstants.DERIVATION_NONE)) throw new XMLSchemaException("rcase-NameAndTypeOK.6", new Object[]{dElement.fName}); throw new XMLSchemaException("rcase-NameAndTypeOK.7", new Object[]{dElement.fName, dElement.fType.getName(), bElement.fType.getName()});
/** * check whether this content violates UPA constraint. * * @param subGroupHandler the substitution group handler * @param xsConstraints the XML Schema Constraint checker * @return true if this content model contains other or list wildcard */ public boolean checkUniqueParticleAttribution(SubstitutionGroupHandler subGroupHandler, XSConstraints xsConstraints) throws XMLSchemaException { // check whether there is conflict between any two leaves for (int i = 0; i < fNumElements; i++) { for (int j = i+1; j < fNumElements; j++) { if (xsConstraints.overlapUPA(fAllElements[i], fAllElements[j], subGroupHandler)) { // REVISIT: do we want to report all errors? or just one? throw new XMLSchemaException("cos-nonambig", new Object[]{fAllElements[i].toString(), fAllElements[j].toString()}); } } } return false; }
/** * check whether this content violates UPA constraint. * * @param subGroupHandler the substitution group handler * @param xsConstraints the XML Schema Constraint checker * @return true if this content model contains other or list wildcard */ public boolean checkUniqueParticleAttribution(SubstitutionGroupHandler subGroupHandler, XSConstraints xsConstraints) throws XMLSchemaException { // check whether there is conflict between any two leaves for (int i = 1; i < fNumElements; i++) { for (int j = i+1; j < fNumElements; j++) { if (xsConstraints.overlapUPA(fElements[i], fElements[j], subGroupHandler)) { // REVISIT: do we want to report all errors? or just one? throw new XMLSchemaException("cos-nonambig", new Object[]{fElements[i].toString(), fElements[j].toString()}); } } } for (int i = fNumElements; i < fNumTotal; i++) { for (int j = i+1; j < fNumTotal; j++) { if (xsConstraints.overlapUPA(fWildcards[i], fWildcards[j])) { // REVISIT: do we want to report all errors? or just one? throw new XMLSchemaException("cos-nonambig", new Object[]{fWildcards[i].toString(), fWildcards[j].toString()}); } } } return false; }
if (gElem != elem && XS11TypeHelper.isTypeTablesComparable(elem.getTypeAlternatives(), gElem.getTypeAlternatives()) && !isTypeTablesEquivalent(elem, gElem)) { throw new XMLSchemaException("cos-element-consistent.4.b", new Object[] {type.fName, elem.fName});
throw new XMLSchemaException("cos-particle-restrict.a", null); throw new XMLSchemaException("cos-particle-restrict.b", null); throw new XMLSchemaException("Internal-Error", new Object[]{"in particleValidRestriction"}); throw new XMLSchemaException("cos-particle-restrict.2", new Object[]{"any:choice,sequence,all,elt"}); throw new XMLSchemaException("Internal-Error", new Object[]{"in particleValidRestriction"}); throw new XMLSchemaException("cos-particle-restrict.2", new Object[]{"all:choice,sequence,elt"}); throw new XMLSchemaException("Internal-Error", new Object[]{"in particleValidRestriction"}); throw new XMLSchemaException("cos-particle-restrict.2", new Object[]{"choice:all,sequence,elt"}); throw new XMLSchemaException("Internal-Error", new Object[]{"in particleValidRestriction"}); throw new XMLSchemaException("cos-particle-restrict.2", new Object[]{"seq:elt"}); throw new XMLSchemaException("Internal-Error",
throw new XMLSchemaException(null, null);