String msg = v.fullyValid(); if (msg != null) { reportValidationProblem("Validation error, element </" +closingElem+">: "+msg);
reportValidationProblem("Required attribute \"{0}\" missing from element <{1}>", attr, elem); } else { doAddDefaultValue(attr);
reportValidationProblem(ErrorConsts.ERR_VLD_UNKNOWN_ATTR, mCurrElem.toString(), mTmpKey.toString()); String exp = attr.getDefaultValue(mContext, this); if (!act.equals(exp)) { reportValidationProblem("Value of attribute \""+attr+"\" (element <"+mCurrElem+">) not \""+exp+"\" as expected, but \""+act+"\"");
reportValidationProblem(ErrorConsts.ERR_VLD_UNKNOWN_ATTR, mCurrElem.toString(), mTmpKey.toString()); String act = (result == null) ? new String(valueChars, valueStart, valueEnd) : result; reportValidationProblem("Value of #FIXED attribute \""+attr+"\" (element <"+mCurrElem+">) not \""+exp+"\" as expected, but \""+act+"\"");
protected void checkIdRefs() throws XMLStreamException { /* 02-Oct-2004, TSa: Now we can also check that all id references * pointed to ids that actually are defined */ if (mIdMap != null) { ElementId ref = mIdMap.getFirstUndefined(); if (ref != null) { // problem! reportValidationProblem("Undefined id '"+ref.getId() +"': referenced from element <" +ref.getElemName()+">, attribute '" +ref.getAttrName()+"'", ref.getLocation()); } } }
reportValidationProblem(ErrorConsts.ERR_VLD_UNKNOWN_ELEM, mTmpKey.toString()); +msg.substring(ix+4); reportValidationProblem("Validation error, encountered element <" +elem.getName()+"> as a child of <" +pname+">: "+msg);
reportValidationProblem("Required attribute '"+attr+"' missing from element <"+elem+">"); } else { doAddDefaultValue(attr);
reportValidationProblem("Required attribute \"{0}\" missing from element <{1}>", attr, elem); } else { doAddDefaultValue(attr);
reportValidationProblem("Required attribute \"{0}\" missing from element <{1}>", attr, elem); } else { doAddDefaultValue(attr);
reportValidationProblem("Required attribute \"{0}\" missing from element <{1}>", attr, elem); } else { doAddDefaultValue(attr);
/** * @return Validation state that should be effective for the parent * element state */ public int validateElementEnd(String localName, String uri, String prefix) throws XMLValidationException { // First, let's remove the top: int ix = --mElemCount; DTDElement closingElem = mElems[ix]; mElems[ix] = null; StructValidator v = mValidators[ix]; mValidators[ix] = null; // Validation? if (v != null) { String msg = v.fullyValid(); if (msg != null) { reportValidationProblem("Validation error, element </" +closingElem+">: "+msg); } } // Then let's get info from parent, if any if (ix < 1) { // root element closing.. checkIdRefs(); // doesn't really matter; epilog/prolog differently handled: return XMLValidator.CONTENT_ALLOW_WS; } return mElems[ix-1].getAllowedContent(); }
/** * @return Validation state that should be effective for the parent * element state */ public int validateElementEnd(String localName, String uri, String prefix) throws XMLValidationException { // First, let's remove the top: int ix = --mElemCount; DTDElement closingElem = mElems[ix]; mElems[ix] = null; StructValidator v = mValidators[ix]; mValidators[ix] = null; // Validation? if (v != null) { String msg = v.fullyValid(); if (msg != null) { reportValidationProblem("Validation error, element </" +closingElem+">: "+msg); } } // Then let's get info from parent, if any if (ix < 1) { // root element closing.. checkIdRefs(); // doesn't really matter; epilog/prolog differently handled: return XMLValidator.CONTENT_ALLOW_WS; } return mElems[ix-1].getAllowedContent(); }
/** * @return Validation state that should be effective for the parent * element state */ public int validateElementEnd(String localName, String uri, String prefix) throws XMLValidationException { // First, let's remove the top: int ix = --mElemCount; DTDElement closingElem = mElems[ix]; mElems[ix] = null; StructValidator v = mValidators[ix]; mValidators[ix] = null; // Validation? if (v != null) { String msg = v.fullyValid(); if (msg != null) { reportValidationProblem("Validation error, element </" +closingElem+">: "+msg); } } // Then let's get info from parent, if any if (ix < 1) { // root element closing.. checkIdRefs(); // doesn't really matter; epilog/prolog differently handled: return XMLValidator.CONTENT_ALLOW_WS; } return mElems[ix-1].getAllowedContent(); }
protected void checkIdRefs() throws XMLStreamException { /* 02-Oct-2004, TSa: Now we can also check that all id references * pointed to ids that actually are defined */ if (mIdMap != null) { ElementId ref = mIdMap.getFirstUndefined(); if (ref != null) { // problem! reportValidationProblem("Undefined id '"+ref.getId() +"': referenced from element <" +ref.getElemName()+">, attribute '" +ref.getAttrName()+"'", ref.getLocation()); } } }
protected void checkIdRefs() throws XMLStreamException { /* 02-Oct-2004, TSa: Now we can also check that all id references * pointed to ids that actually are defined */ if (mIdMap != null) { ElementId ref = mIdMap.getFirstUndefined(); if (ref != null) { // problem! reportValidationProblem("Undefined id '"+ref.getId() +"': referenced from element <" +ref.getElemName()+">, attribute '" +ref.getAttrName()+"'", ref.getLocation()); } } }
protected void checkIdRefs() throws XMLValidationException { /* 02-Oct-2004, TSa: Now we can also check that all id references * pointed to ids that actually are defined */ if (mIdMap != null) { ElementId ref = mIdMap.getFirstUndefined(); if (ref != null) { // problem! reportValidationProblem("Undefined id '"+ref.getId() +"': referenced from element <" +ref.getElemName()+">, attribute '" +ref.getAttrName()+"'", ref.getLocation()); } } }
protected void checkIdRefs() throws XMLStreamException { /* 02-Oct-2004, TSa: Now we can also check that all id references * pointed to ids that actually are defined */ if (mIdMap != null) { ElementId ref = mIdMap.getFirstUndefined(); if (ref != null) { // problem! reportValidationProblem("Undefined id '"+ref.getId() +"': referenced from element <" +ref.getElemName()+">, attribute '" +ref.getAttrName()+"'", ref.getLocation()); } } }
protected void checkIdRefs() throws XMLStreamException { /* 02-Oct-2004, TSa: Now we can also check that all id references * pointed to ids that actually are defined */ if (mIdMap != null) { ElementId ref = mIdMap.getFirstUndefined(); if (ref != null) { // problem! reportValidationProblem("Undefined id '"+ref.getId() +"': referenced from element <" +ref.getElemName()+">, attribute '" +ref.getAttrName()+"'", ref.getLocation()); } } }
protected void checkIdRefs() throws XMLValidationException { /* 02-Oct-2004, TSa: Now we can also check that all id references * pointed to ids that actually are defined */ if (mIdMap != null) { ElementId ref = mIdMap.getFirstUndefined(); if (ref != null) { // problem! reportValidationProblem("Undefined id '"+ref.getId() +"': referenced from element <" +ref.getElemName()+">, attribute '" +ref.getAttrName()+"'", ref.getLocation()); } } }
protected void checkIdRefs() throws XMLValidationException { /* 02-Oct-2004, TSa: Now we can also check that all id references * pointed to ids that actually are defined */ if (mIdMap != null) { ElementId ref = mIdMap.getFirstUndefined(); if (ref != null) { // problem! reportValidationProblem("Undefined id '"+ref.getId() +"': referenced from element <" +ref.getElemName()+">, attribute '" +ref.getAttrName()+"'", ref.getLocation()); } } }