[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:
parent
fcf6309082
commit
298b1a5178
@ -3223,7 +3223,13 @@ nsSchemaLoader::ProcessFacet(nsISVSchemaErrorHandler* aErrorHandler,
|
|||||||
|
|
||||||
nsAutoString valueStr;
|
nsAutoString valueStr;
|
||||||
aElement->GetAttribute(NS_LITERAL_STRING("value"), 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;
|
nsAutoString elementName;
|
||||||
rv = aElement->GetTagName(elementName);
|
rv = aElement->GetTagName(elementName);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|||||||
@ -66,6 +66,9 @@
|
|||||||
PR_BEGIN_MACRO \
|
PR_BEGIN_MACRO \
|
||||||
if (aErrorHandler) { \
|
if (aErrorHandler) { \
|
||||||
aErrorHandler->OnError(status, statusMessage); \
|
aErrorHandler->OnError(status, statusMessage); \
|
||||||
|
} else { \
|
||||||
|
printf("Error while loading schema: %s\n", \
|
||||||
|
NS_ConvertUTF16toUTF8(statusMessage).get()); \
|
||||||
} \
|
} \
|
||||||
PR_END_MACRO
|
PR_END_MACRO
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user