Bug 329970 - nsSchemaLoader does not copy over attributes for DERIVATION_RESTRICTION_COMPLEX r=peterv
git-svn-id: svn://10.0.0.236/trunk@192425 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -2057,7 +2057,9 @@ nsSchemaLoader::ProcessComplexContent(nsIWebServiceErrorHandler* aErrorHandler,
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
nsCOMPtr<nsISchemaComplexType> complexBaseType(do_QueryInterface(baseType));
|
||||
|
||||
if (tagName == nsSchemaAtoms::sRestriction_atom) {
|
||||
*aDerivation = nsISchemaComplexType::DERIVATION_RESTRICTION_COMPLEX;
|
||||
rv = ProcessComplexTypeBody(aErrorHandler, aSchema, childElement,
|
||||
@@ -2068,7 +2070,6 @@ nsSchemaLoader::ProcessComplexContent(nsIWebServiceErrorHandler* aErrorHandler,
|
||||
|
||||
nsCOMPtr<nsISchemaModelGroup> sequence;
|
||||
nsSchemaModelGroup* sequenceInst = nsnull;
|
||||
nsCOMPtr<nsISchemaComplexType> complexBaseType(do_QueryInterface(baseType));
|
||||
if (complexBaseType) {
|
||||
// XXX Should really be cloning
|
||||
nsCOMPtr<nsISchemaModelGroup> baseGroup;
|
||||
@@ -2144,43 +2145,6 @@ nsSchemaLoader::ProcessComplexContent(nsIWebServiceErrorHandler* aErrorHandler,
|
||||
}
|
||||
|
||||
aComplexType->SetModelGroup(sequence);
|
||||
}
|
||||
|
||||
|
||||
// Copy over the attributes from the base type
|
||||
// XXX Should really be cloning
|
||||
PRUint32 attrIndex, attrCount;
|
||||
complexBaseType->GetAttributeCount(&attrCount);
|
||||
|
||||
for (attrIndex = 0; attrIndex < attrCount; attrIndex++) {
|
||||
nsCOMPtr<nsISchemaAttributeComponent> attribute;
|
||||
|
||||
rv = complexBaseType->GetAttributeByIndex(attrIndex,
|
||||
getter_AddRefs(attribute));
|
||||
if (NS_FAILED(rv)) {
|
||||
nsAutoString errorMsg;
|
||||
errorMsg.AppendLiteral("Failure processing schema, cannot clone ");
|
||||
errorMsg.AppendLiteral("attributes from base type \"");
|
||||
errorMsg.Append(baseStr);
|
||||
errorMsg.AppendLiteral("\"");
|
||||
|
||||
NS_SCHEMALOADER_FIRE_ERROR(rv, errorMsg);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = aComplexType->AddAttribute(attribute);
|
||||
if (NS_FAILED(rv)) {
|
||||
nsAutoString errorMsg;
|
||||
errorMsg.AppendLiteral("Failure processing schema, cannot clone ");
|
||||
errorMsg.AppendLiteral("attributes from base type \"");
|
||||
errorMsg.Append(baseStr);
|
||||
errorMsg.AppendLiteral("\"");
|
||||
|
||||
NS_SCHEMALOADER_FIRE_ERROR(rv, errorMsg);
|
||||
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2201,6 +2165,46 @@ nsSchemaLoader::ProcessComplexContent(nsIWebServiceErrorHandler* aErrorHandler,
|
||||
*aContentModel = explicitContent;
|
||||
}
|
||||
}
|
||||
|
||||
// Copy over the attributes from the base type
|
||||
// XXX Should really be cloning
|
||||
if (complexBaseType) {
|
||||
PRUint32 attrIndex, attrCount;
|
||||
complexBaseType->GetAttributeCount(&attrCount);
|
||||
|
||||
for (attrIndex = 0; attrIndex < attrCount; attrIndex++) {
|
||||
nsCOMPtr<nsISchemaAttributeComponent> attribute;
|
||||
|
||||
rv = complexBaseType->GetAttributeByIndex(attrIndex,
|
||||
getter_AddRefs(attribute));
|
||||
if (NS_FAILED(rv)) {
|
||||
nsAutoString errorMsg;
|
||||
errorMsg.AppendLiteral("Failure processing schema, cannot clone ");
|
||||
errorMsg.AppendLiteral("attributes from base type \"");
|
||||
errorMsg.Append(baseStr);
|
||||
errorMsg.AppendLiteral("\"");
|
||||
|
||||
NS_SCHEMALOADER_FIRE_ERROR(rv, errorMsg);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = aComplexType->AddAttribute(attribute);
|
||||
if (NS_FAILED(rv)) {
|
||||
nsAutoString errorMsg;
|
||||
errorMsg.AppendLiteral("Failure processing schema, cannot clone ");
|
||||
errorMsg.AppendLiteral("attributes from base type \"");
|
||||
errorMsg.Append(baseStr);
|
||||
errorMsg.AppendLiteral("\"");
|
||||
|
||||
NS_SCHEMALOADER_FIRE_ERROR(rv, errorMsg);
|
||||
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user