Bug 333006 - Schema Validation doesn't handle default attribute types. r=aaronr/allan

git-svn-id: svn://10.0.0.236/trunk@194004 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
doronr%us.ibm.com 2006-04-10 16:51:32 +00:00
parent 3577a2287a
commit e543190699

View File

@ -401,6 +401,8 @@ nsSchemaValidator::ValidateSimpletype(const nsAString & aNodeValue,
nsISchemaSimpleType *aSchemaSimpleType,
PRBool *aResult)
{
NS_ENSURE_ARG(aSchemaSimpleType);
// get the simpletype type.
PRUint16 simpleTypeValue;
nsresult rv = aSchemaSimpleType->GetSimpleType(&simpleTypeValue);
@ -4345,7 +4347,15 @@ nsSchemaValidator::ValidateSchemaAttribute(nsIDOMNode* aNode,
// since we default to invalid.
LOG((" -- attribute prohibited!"));
} else {
rv = ValidateSimpletype(attrValue, simpleType, &isValid);
if (simpleType) {
rv = ValidateSimpletype(attrValue, simpleType, &isValid);
} else {
// If no type exists (ergo no simpleType), we should use the
// simple ur-type definition defined at:
// (http://www.w3.org/TR/xmlschema-1/#simple-ur-type-itself).
// XXX: So for now, we default to true.
isValid = PR_TRUE;
}
}
}