void checkElementMatchesRootElementDecl(final XSElementDecl rootElementDecl, final QName element) { // Report an error if the name of the element does // not match the name of the specified element declaration. if (element.localpart != rootElementDecl.fName || element.uri != rootElementDecl.fTargetNamespace) { reportSchemaError("cvc-elt.1.b", new Object[] {element.rawname, rootElementDecl.fName}); } } // checkElementMatchesRootElementDecl
void processRootElementDeclQName(final javax.xml.namespace.QName rootElementDeclQName, final QName element) { String rootElementDeclNamespace = rootElementDeclQName.getNamespaceURI(); // Add namespace to symbol table, to make sure it's interned. // This namespace may be later compared with other values using ==. rootElementDeclNamespace = fSymbolTable.addSymbol(rootElementDeclNamespace); if (rootElementDeclNamespace != null && rootElementDeclNamespace.equals(XMLConstants.NULL_NS_URI)) { rootElementDeclNamespace = null; } final SchemaGrammar grammarForRootElement = findSchemaGrammar( XSDDescription.CONTEXT_ELEMENT, rootElementDeclNamespace, null, null, null); if (grammarForRootElement != null) { fCurrentElemDecl = grammarForRootElement.getGlobalElementDecl(rootElementDeclQName.getLocalPart()); } if (fCurrentElemDecl == null) { String declName = (rootElementDeclQName.getPrefix().equals(XMLConstants.DEFAULT_NS_PREFIX)) ? rootElementDeclQName.getLocalPart() : rootElementDeclQName.getPrefix()+":"+rootElementDeclQName.getLocalPart(); reportSchemaError("cvc-elt.1.a", new Object[] {declName}); } else { checkElementMatchesRootElementDecl(fCurrentElemDecl, element); } } // processRootElementDeclQName
boolean getXsiNil(QName element, String xsiNil) { // Element Locally Valid (Element) // 3 The appropriate case among the following must be true: // 3.1 If {nillable} is false, then there must be no attribute information item among the element information item's [attributes] whose [namespace name] is identical to http://www.w3.org/2001/XMLSchema-instance and whose [local name] is nil. if (fCurrentElemDecl != null && !fCurrentElemDecl.getNillable()) { reportSchemaError( "cvc-elt.3.1", new Object[] { element.rawname, SchemaSymbols.URI_XSI + "," + SchemaSymbols.XSI_NIL }); } // 3.2 If {nillable} is true and there is such an attribute information item and its actual value is true , then all of the following must be true: // 3.2.2 There must be no fixed {value constraint}. else { String value = XMLChar.trim(xsiNil); if (value.equals(SchemaSymbols.ATTVAL_TRUE) || value.equals(SchemaSymbols.ATTVAL_TRUE_1)) { if (fCurrentElemDecl != null && fCurrentElemDecl.getConstraintType() == XSConstants.VC_FIXED) { reportSchemaError( "cvc-elt.3.2.2", new Object[] { element.rawname, SchemaSymbols.URI_XSI + "," + SchemaSymbols.XSI_NIL }); } return true; } } return false; }
void processRootTypeQName(final javax.xml.namespace.QName rootTypeQName) { String rootTypeNamespace = rootTypeQName.getNamespaceURI(); // Add namespace to symbol table, to make sure it's interned. // This namespace may be later compared with other values using ==. rootTypeNamespace = fSymbolTable.addSymbol(rootTypeNamespace); if (rootTypeNamespace != null && rootTypeNamespace.equals(XMLConstants.NULL_NS_URI)) { rootTypeNamespace = null; } if (SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(rootTypeNamespace)) { String rootLocalPart = rootTypeQName.getLocalPart(); if (isValidBuiltInTypeName(rootLocalPart)) { SchemaGrammar s4s = SchemaGrammar.getS4SGrammar(fSchemaVersion); fCurrentType = s4s.getGlobalTypeDecl(rootLocalPart); } } else { final SchemaGrammar grammarForRootType = findSchemaGrammar( XSDDescription.CONTEXT_ELEMENT, rootTypeNamespace, null, null, null); if (grammarForRootType != null) { fCurrentType = grammarForRootType.getGlobalTypeDecl(rootTypeQName.getLocalPart()); } } if (fCurrentType == null) { String typeName = (rootTypeQName.getPrefix().equals(XMLConstants.DEFAULT_NS_PREFIX)) ? rootTypeQName.getLocalPart() : rootTypeQName.getPrefix()+":"+rootTypeQName.getLocalPart(); reportSchemaError("cvc-type.1", new Object[] {typeName}); } } // processRootTypeQName
reportSchemaError("cvc-complex-type.2.1", new Object[] { element.rawname }); reportSchemaError("cvc-complex-type.2.2", new Object[] { element.rawname }); XSSimpleType dv = ctype.fXSSimpleType; try { reportSchemaError(e.getKey(), e.getArgs()); reportSchemaError("cvc-complex-type.2.2", new Object[] { element.rawname }); reportSchemaError("cvc-complex-type.2.3", new Object[] { element.rawname }); final int required = minOccurs - count; if (required > 1) { reportSchemaError("cvc-complex-type.2.4.j", new Object[] { element.rawname, fCurrentCM.getTermName(occurenceInfo[3]), Integer.toString(minOccurs), Integer.toString(required) }); reportSchemaError("cvc-complex-type.2.4.i", new Object[] { element.rawname, fCurrentCM.getTermName(occurenceInfo[3]), Integer.toString(minOccurs) }); reportSchemaError("cvc-complex-type.2.4.b", new Object[] { element.rawname, expected }); reportSchemaError("cvc-complex-type.2.4.b", new Object[] { element.rawname, expected });
reportSchemaError("cvc-type.3.1.2", new Object[] { element.rawname }); reportSchemaError(e.getKey(), e.getArgs()); reportSchemaError( "cvc-type.3.1.3", new Object[] { element.rawname, textContent });
if (assertImpl.getAttrName() == null) { fXmlSchemaValidator.reportSchemaError("cvc-assertions-valid-union-elem", new Object[] {value, element.rawname, ((XSSimpleTypeDecl)simpleTypeDefn).getTypeName()}); fXmlSchemaValidator.reportSchemaError("cvc-assertions-valid-union-attr", new Object[] {value, assertImpl.getAttrName(), element.rawname, ((XSSimpleTypeDecl)simpleTypeDefn).getTypeName()}); fXmlSchemaValidator.reportSchemaError("cvc-datatype-valid.1.2.3", new Object[] {value, ((XSSimpleTypeDecl)simpleTypeDefn).getTypeName()});
typeName = (QName) fQNameDV.validate(xsiType, fValidationState, null); } catch (InvalidDatatypeValueException e) { reportSchemaError(e.getKey(), e.getArgs()); reportSchemaError( "cvc-elt.4.1", new Object[] { reportSchemaError("cvc-elt.4.2", new Object[] { element.rawname, xsiType }); return null; reportSchemaError( "cvc-elt.4.3", new Object[] { element.rawname, xsiType, XS11TypeHelper.getSchemaTypeName(fCurrentType)});
reportSchemaError( "cvc-elt.3.2.1", new Object[] { null) == null) reportSchemaError( "cvc-elt.5.1.1", new Object[] { reportSchemaError("cvc-elt.5.2.2.1", new Object[] { element.rawname }); reportSchemaError( "cvc-elt.5.2.2.2.1", new Object[] { if (actualValue != null && !EqualityHelper.isEqual(fValidatedInfo, fCurrentElemDecl.fDefault, fSchemaVersion)) { reportSchemaError( "cvc-elt.5.2.2.2.2", new Object[] { reportSchemaError( "cvc-elt.5.2.2.2.2", new Object[] {
fXmlSchemaValidator.reportSchemaError("cvc-assertion-failure-mesg", new Object[] {userDefinedMessage, mesgSuffix}); fXmlSchemaValidator.reportSchemaError(key, new Object[] {elemNameAnnotation, assertImpl.getTest().getXPathStr(), typeNameStr, mesgSuffix}); fXmlSchemaValidator.reportSchemaError("cvc-assertions-valid", new Object[] {value, assertImpl.getTest().getXPathStr(), exceptionMesg}); fXmlSchemaValidator.reportSchemaError(key, new Object[] {elemNameAnnotation, assertImpl.getTest().getXPathStr(), typeNameStr, mesgSuffix});
fXmlSchemaValidator.reportSchemaError("cvc-type.3.1.3", new Object[] {element.rawname, value}); fXmlSchemaValidator.reportSchemaError("cvc-attribute.3", new Object[] {element.rawname, attrQname.localpart, value, ((XSSimpleTypeDecl)simpleTypeDefn).getTypeName()});
reportSchemaError( "cvc-type.3.1.1", new Object[] { element.rawname, fTempQName.rawname }); if (attrWildcard == null || !allowAttribute(attrWildcard, fTempQName, grammar)) { reportSchemaError( "cvc-complex-type.3.2.2", new Object[] { element.rawname, fTempQName.rawname }); reportSchemaError( "cvc-complex-type.3.2.2", new Object[] { element.rawname, fTempQName.rawname }); && ((XSSimpleType) currDecl.fType).isIDType()) { if (wildcardIDName != null) { reportSchemaError( "cvc-complex-type.5.1", new Object[] { element.rawname, currDecl.fName, wildcardIDName }); reportSchemaError( "cvc-complex-type.5.2", new Object[] { element.rawname, wildcardIDName, attrGrp.fIDAttrName });
reportSchemaError(idve.getKey(), idve.getArgs()); reportSchemaError( "cvc-attribute.3", new Object[] { element.rawname, fTempQName.rawname, attrValue, reportSchemaError( "cvc-attribute.4", new Object[] { && currUse.fConstraintType == XSConstants.VC_FIXED) { if (!EqualityHelper.isEqual(fValidatedInfo, currUse.fDefault, fSchemaVersion)) { reportSchemaError( "cvc-complex-type.3.1", new Object[] {
final int required = minOccurs - count; if (required > 1) { reportSchemaError("cvc-complex-type.2.4.h", new Object[] { element.rawname, fCurrentCM.getTermName(occurenceInfo[3]), Integer.toString(minOccurs), Integer.toString(required) }); reportSchemaError("cvc-complex-type.2.4.g", new Object[] { element.rawname, fCurrentCM.getTermName(occurenceInfo[3]), Integer.toString(minOccurs) }); reportSchemaError("cvc-complex-type.2.4.e", new Object[] { element.rawname, expected, Integer.toString(maxOccurs) }); reportSchemaError("cvc-complex-type.2.4.a", new Object[] { elemExpandedQname, expected }); reportSchemaError("cvc-complex-type.2.4.a", new Object[] { elemExpandedQname, expected }); reportSchemaError("cvc-complex-type.2.4.f", new Object[] { fCurrentCM.getTermName(occurenceInfo[3]), Integer.toString(maxOccurs) }); reportSchemaError("cvc-complex-type.2.4.d", new Object[] { element.rawname }); reportSchemaError("cvc-complex-type.2.4.d", new Object[] { element.rawname }); reportSchemaError("cvc-complex-type.2.4.c", new Object[] { element.rawname }); reportSchemaError( "cos-element-consistent.4.a", new Object[] { element.rawname, fCurrentType, elemType.getName()}); if (errorSize > 0) { for (int i=0; i<errorSize; ++i) {
reportSchemaError( "cvc-complex-type.4", new Object[] { element.rawname, currDecl.fName }); reportSchemaError(idve.getKey(), idve.getArgs());
if (invIdRefs != null) { while (invIdRefs.hasNext()) { reportSchemaError("cvc-id.1", new Object[] { invIdRefs.next() });