[XForms] NPOTDB xsd:enumeration with empty value breaks schema processing. Bug 515067, p=philipp r=doronr+aaronr

git-svn-id: svn://10.0.0.236/trunk@258350 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
aaronr%us.ibm.com 2009-09-10 20:55:33 +00:00
parent fcf6309082
commit 298b1a5178
2 changed files with 10 additions and 1 deletions

View File

@ -3223,7 +3223,13 @@ nsSchemaLoader::ProcessFacet(nsISVSchemaErrorHandler* aErrorHandler,
nsAutoString valueStr;
aElement->GetAttribute(NS_LITERAL_STRING("value"), valueStr);
if (valueStr.IsEmpty()) {
/*
* Enumerations contain data depending on the base type. Some base types allow empty
* content (e.g. xsd:string), others don't.
* XXX: Check the requirements of the base type for the enumeration value.
*/
if (aTagName != nsSchemaAtoms::sEnumeration_atom && valueStr.IsEmpty()) {
nsAutoString elementName;
rv = aElement->GetTagName(elementName);
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -66,6 +66,9 @@
PR_BEGIN_MACRO \
if (aErrorHandler) { \
aErrorHandler->OnError(status, statusMessage); \
} else { \
printf("Error while loading schema: %s\n", \
NS_ConvertUTF16toUTF8(statusMessage).get()); \
} \
PR_END_MACRO