NPOTDB Bug 333006 - Schema validation doesn't handle default attribute types. r=allan/aaronr 181=me
git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@194013 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -400,6 +400,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);
|
||||
@@ -4349,7 +4351,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user