knoaman 2003/03/10 13:27:11 Modified: c/src/xercesc/validators/schema TraverseSchema.cpp Log: Fix for complex type declarations with mixed content. Revision Changes Path 1.64 +15 -17 xml-xerces/c/src/xercesc/validators/schema/TraverseSchema.cpp Index: TraverseSchema.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/TraverseSchema.cpp,v retrieving revision 1.63 retrieving revision 1.64 diff -u -r1.63 -r1.64 --- TraverseSchema.cpp 10 Mar 2003 16:50:35 -0000 1.63 +++ TraverseSchema.cpp 10 Mar 2003 21:27:11 -0000 1.64 @@ -5565,25 +5565,9 @@ throw TraverseSchema::InvalidComplexTypeInfo; // REVISIT - should we continue } - // Check for derivation valid (extension) - 1.4.2.2 - if (baseContentType != SchemaElementDecl::Empty - && baseContentType != SchemaElementDecl::Simple) { - if ((isMixed && baseContentType == SchemaElementDecl::Children) - || (!isMixed && baseContentType != SchemaElementDecl::Children)) { - - reportSchemaError(ctElem, XMLUni::fgXMLErrDomain, XMLErrs::MixedOrElementOnly, baseLocalPart, typeName); - throw TraverseSchema::InvalidComplexTypeInfo; //REVISIT - should we continue - } - } - processElements(ctElem, baseTypeInfo, typeInfo); } } - else if (isBaseAnyType && typeDerivedBy == SchemaSymbols::XSD_EXTENSION && !isMixed) { - - reportSchemaError(ctElem, XMLUni::fgXMLErrDomain, XMLErrs::MixedOrElementOnly, baseLocalPart, typeName); - throw TraverseSchema::InvalidComplexTypeInfo; //REVISIT - should we continue - } if (childElem != 0) { @@ -5687,6 +5671,14 @@ throw TraverseSchema::InvalidComplexTypeInfo; // REVISIT - should we continue } + // Check for derivation valid (extension) - 1.4.3.2.2.1 + if ((isMixed && baseContentType == SchemaElementDecl::Children) + || (!isMixed && baseContentType != SchemaElementDecl::Children)) { + + reportSchemaError(ctElem, XMLUni::fgXMLErrDomain, XMLErrs::MixedOrElementOnly, baseLocalPart, typeName); + throw TraverseSchema::InvalidComplexTypeInfo; //REVISIT - should we continue + } + typeInfo->setAdoptContentSpec(false); typeInfo->setContentSpec( new ContentSpecNode(ContentSpecNode::Sequence, @@ -5723,6 +5715,12 @@ typeInfo->setAdoptContentSpec(false); typeInfo->setContentSpec(new ContentSpecNode(ContentSpecNode::Sequence, anySpecNode, specNode)); typeInfo->setAdoptContentSpec(true); + + if (!isMixed) { + + reportSchemaError(ctElem, XMLUni::fgXMLErrDomain, XMLErrs::MixedOrElementOnly, baseLocalPart, typeName); + throw TraverseSchema::InvalidComplexTypeInfo; //REVISIT - should we continue + } } typeInfo->setContentType(SchemaElementDecl::Mixed_Complex);
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]