bug 284351 - nsSchemaLoader doesn't handle xsd:complexType correctly. r/sr=peterv

This commit is contained in:
doronr%us.ibm.com 2005-03-08 21:34:41 +00:00
parent b21ae8f2b4
commit 5938f059e5

View File

@ -1301,31 +1301,41 @@ nsSchemaLoader::ProcessComplexType(nsIWebServiceErrorHandler* aErrorHandler,
PRUint16 derivation = nsISchemaComplexType::DERIVATION_SELF_CONTAINED; PRUint16 derivation = nsISchemaComplexType::DERIVATION_SELF_CONTAINED;
nsCOMPtr<nsISchemaType> baseType; nsCOMPtr<nsISchemaType> baseType;
nsCOMPtr<nsISchemaModelGroup> modelGroup; nsCOMPtr<nsISchemaModelGroup> modelGroup;
while (NS_SUCCEEDED(iterator.GetNextChild(getter_AddRefs(childElement), while (NS_SUCCEEDED(iterator.GetNextChild(getter_AddRefs(childElement),
getter_AddRefs(tagName))) && getter_AddRefs(tagName))) &&
childElement) { childElement) {
if (tagName == nsSchemaAtoms::sSimpleContent_atom) { if (tagName == nsSchemaAtoms::sSimpleContent_atom) {
contentModel = nsISchemaComplexType::CONTENT_MODEL_SIMPLE; contentModel = nsISchemaComplexType::CONTENT_MODEL_SIMPLE;
rv = ProcessSimpleContent(aErrorHandler, aSchema, rv = ProcessSimpleContent(aErrorHandler, aSchema, childElement, typeInst,
childElement, typeInst,
&derivation, getter_AddRefs(baseType)); &derivation, getter_AddRefs(baseType));
break; break;
} }
else if (tagName == nsSchemaAtoms::sComplexContent_atom) {
rv = ProcessComplexContent(aErrorHandler, aSchema, if (tagName == nsSchemaAtoms::sComplexContent_atom) {
childElement, typeInst, rv = ProcessComplexContent(aErrorHandler, aSchema, childElement, typeInst,
&contentModel, &derivation, &contentModel, &derivation,
getter_AddRefs(baseType)); getter_AddRefs(baseType));
break; break;
} }
else if (tagName != nsSchemaAtoms::sAnnotation_atom) {
rv = ProcessComplexTypeBody(aErrorHandler, aSchema, if (tagName == nsSchemaAtoms::sModelGroup_atom ||
tagName == nsSchemaAtoms::sAll_atom ||
tagName == nsSchemaAtoms::sChoice_atom ||
tagName == nsSchemaAtoms::sSequence_atom ||
tagName == nsSchemaAtoms::sAttribute_atom ||
tagName == nsSchemaAtoms::sAttributeGroup_atom ||
tagName == nsSchemaAtoms::sAnyAttribute_atom) {
rv = ProcessComplexTypeBody(aErrorHandler, aSchema,
aElement, typeInst, nsnull, aElement, typeInst, nsnull,
&contentModel); &contentModel);
break; break;
} }
if (tagName == nsSchemaAtoms::sAnnotation_atom) {
// XXX: skipping for now
}
else { else {
// Unexpected schema element // Unexpected schema element
nsAutoString elementName; nsAutoString elementName;