You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ca...@apache.org on 2007/01/25 21:19:51 UTC

svn commit: r499946 - in /xerces/c/trunk: samples/src/PSVIWriter/ src/xercesc/dom/impl/ src/xercesc/internal/ src/xercesc/util/ src/xercesc/util/Transcoders/Uniconv390/ src/xercesc/validators/schema/

Author: cargilld
Date: Thu Jan 25 12:19:47 2007
New Revision: 499946

URL: http://svn.apache.org/viewvc?view=rev&rev=499946
Log:
check in schema fixes, utf32

Modified:
    xerces/c/trunk/samples/src/PSVIWriter/PSVIWriterHandlers.cpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.cpp
    xerces/c/trunk/src/xercesc/internal/IGXMLScanner2.cpp
    xerces/c/trunk/src/xercesc/internal/XMLReader.cpp
    xerces/c/trunk/src/xercesc/util/PlatformUtils.cpp
    xerces/c/trunk/src/xercesc/util/PlatformUtils.hpp
    xerces/c/trunk/src/xercesc/util/TransService.cpp
    xerces/c/trunk/src/xercesc/util/TransService.hpp
    xerces/c/trunk/src/xercesc/util/Transcoders/Uniconv390/Uniconv390TransService.cpp
    xerces/c/trunk/src/xercesc/util/XMLUni.cpp
    xerces/c/trunk/src/xercesc/util/XMLUni.hpp
    xerces/c/trunk/src/xercesc/validators/schema/TraverseSchema.cpp

Modified: xerces/c/trunk/samples/src/PSVIWriter/PSVIWriterHandlers.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/PSVIWriter/PSVIWriterHandlers.cpp?view=diff&rev=499946&r1=499945&r2=499946
==============================================================================
--- xerces/c/trunk/samples/src/PSVIWriter/PSVIWriterHandlers.cpp (original)
+++ xerces/c/trunk/samples/src/PSVIWriter/PSVIWriterHandlers.cpp Thu Jan 25 12:19:47 2007
@@ -874,16 +874,22 @@
 	if (annotation == NULL) {
 		sendElementEmpty(PSVIUni::fgAnnotation);
 	} else {
-		XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument* document = DOMImplementationRegistry::getDOMImplementation(XMLUni::fgZeroLenString)->
+        XSAnnotation* annot;
+        annot = annotation;
+
+        while (annot) {
+		    XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument* document = DOMImplementationRegistry::getDOMImplementation(XMLUni::fgZeroLenString)->
                 createDocument();
-		annotation->writeAnnotation((DOMNode*)document, XSAnnotation::W3C_DOM_DOCUMENT);
-		DOMElement* elem = document->getDocumentElement();
-		sendIndentedElement(PSVIUni::fgAnnotation);
-		processDOMElement(PSVIUni::fgApplicationInformation, elem, PSVIUni::fgAppinfo);
-		processDOMElement(PSVIUni::fgUserInformation, elem, PSVIUni::fgDocumentation);
-		processDOMAttributes(elem->getAttributes());
-		sendUnindentedElement(PSVIUni::fgAnnotation);
-        document->release();
+		    annot->writeAnnotation((DOMNode*)document, XSAnnotation::W3C_DOM_DOCUMENT);
+		    DOMElement* elem = document->getDocumentElement();
+		    sendIndentedElement(PSVIUni::fgAnnotation);
+		    processDOMElement(PSVIUni::fgApplicationInformation, elem, PSVIUni::fgAppinfo);
+		    processDOMElement(PSVIUni::fgUserInformation, elem, PSVIUni::fgDocumentation);
+		    processDOMAttributes(elem->getAttributes());
+		    sendUnindentedElement(PSVIUni::fgAnnotation);
+            document->release();
+            annot = annot->getNext();
+        }
 	}
 }
 

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.cpp?view=diff&rev=499946&r1=499945&r2=499946
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMLSSerializerImpl.cpp Thu Jan 25 12:19:47 2007
@@ -1674,7 +1674,8 @@
     }
     else if ((XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUCS4EncodingString)  == 0) ||
              (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUCS4EncodingString2) == 0) ||
-             (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUCS4EncodingString3) == 0)  )
+             (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUCS4EncodingString3) == 0) ||
+             (XMLString::compareIStringASCII(fEncodingUsed, XMLUni::fgUCS4EncodingString4) == 0)  )
     {
 		if (XMLPlatformUtils::fgXMLChBigEndian)
 	        fFormatter->writeBOM(BOM_ucs4be, 4);

Modified: xerces/c/trunk/src/xercesc/internal/IGXMLScanner2.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/internal/IGXMLScanner2.cpp?view=diff&rev=499946&r1=499945&r2=499946
==============================================================================
--- xerces/c/trunk/src/xercesc/internal/IGXMLScanner2.cpp (original)
+++ xerces/c/trunk/src/xercesc/internal/IGXMLScanner2.cpp Thu Jan 25 12:19:47 2007
@@ -1799,7 +1799,7 @@
                         }
                     }
 
-                    grammar = new (fGrammarPoolMemoryManager) SchemaGrammar(fGrammarPoolMemoryManager);
+                    SchemaGrammar* grammar = new (fGrammarPoolMemoryManager) SchemaGrammar(fGrammarPoolMemoryManager);
                     XMLSchemaDescription* gramDesc = (XMLSchemaDescription*) grammar->getGrammarDescription();
                     gramDesc->setContextType(XMLSchemaDescription::CONTEXT_PREPARSE);
                     gramDesc->setLocationHints(srcToFill->getSystemId());
@@ -1808,7 +1808,7 @@
                     (
                         root
                         , fURIStringPool
-                        , (SchemaGrammar*) grammar
+                        , grammar
                         , fGrammarResolver
                         , this
                         , srcToFill->getSystemId()

Modified: xerces/c/trunk/src/xercesc/internal/XMLReader.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/internal/XMLReader.cpp?view=diff&rev=499946&r1=499945&r2=499946
==============================================================================
--- xerces/c/trunk/src/xercesc/internal/XMLReader.cpp (original)
+++ xerces/c/trunk/src/xercesc/internal/XMLReader.cpp Thu Jan 25 12:19:47 2007
@@ -1281,7 +1281,8 @@
     }
     else if (!XMLString::compareString(inputEncoding, XMLUni::fgUCS4EncodingString)
          ||  !XMLString::compareString(inputEncoding, XMLUni::fgUCS4EncodingString2)
-         ||  !XMLString::compareString(inputEncoding, XMLUni::fgUCS4EncodingString3))
+         ||  !XMLString::compareString(inputEncoding, XMLUni::fgUCS4EncodingString3)
+         ||  !XMLString::compareString(inputEncoding, XMLUni::fgUCS4EncodingString4))
     {
         fMemoryManager->deallocate(inputEncoding);
 

Modified: xerces/c/trunk/src/xercesc/util/PlatformUtils.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/PlatformUtils.cpp?view=diff&rev=499946&r1=499945&r2=499946
==============================================================================
--- xerces/c/trunk/src/xercesc/util/PlatformUtils.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/PlatformUtils.cpp Thu Jan 25 12:19:47 2007
@@ -167,6 +167,9 @@
 // ---------------------------------------------------------------------------
 XMLNetAccessor*         XMLPlatformUtils::fgNetAccessor = 0;
 XMLTransService*        XMLPlatformUtils::fgTransService = 0;
+#ifdef OS390
+XMLTransService*        XMLPlatformUtils::fgTransService2 = 0;
+#endif
 PanicHandler*           XMLPlatformUtils::fgUserPanicHandler = 0;
 PanicHandler*           XMLPlatformUtils::fgDefaultPanicHandler = 0;
 MemoryManager*          XMLPlatformUtils::fgMemoryManager = 0;

Modified: xerces/c/trunk/src/xercesc/util/PlatformUtils.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/PlatformUtils.hpp?view=diff&rev=499946&r1=499945&r2=499946
==============================================================================
--- xerces/c/trunk/src/xercesc/util/PlatformUtils.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/PlatformUtils.hpp Thu Jan 25 12:19:47 2007
@@ -99,6 +99,9 @@
       * among parser instances within that process.
       */
     static XMLTransService*     fgTransService;
+#ifdef OS390
+    static XMLTransService*     fgTransService2;
+#endif
 
     /** The Panic Handler
       *

Modified: xerces/c/trunk/src/xercesc/util/TransService.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/TransService.cpp?view=diff&rev=499946&r1=499945&r2=499946
==============================================================================
--- xerces/c/trunk/src/xercesc/util/TransService.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/TransService.cpp Thu Jan 25 12:19:47 2007
@@ -464,6 +464,15 @@
             , false
         )
     );
+    gMappings->put
+    (
+		(void*)XMLUni::fgUCS4EncodingString4,
+        new EEndianNameMapFor<XMLUCS4Transcoder>
+        (
+            XMLUni::fgUCS4EncodingString4
+            , false
+        )
+    );
 
     //
     //  Add in our mappings for IBM037, and the one alias we support for

Modified: xerces/c/trunk/src/xercesc/util/TransService.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/TransService.hpp?view=diff&rev=499946&r1=499945&r2=499946
==============================================================================
--- xerces/c/trunk/src/xercesc/util/TransService.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/TransService.hpp Thu Jan 25 12:19:47 2007
@@ -150,6 +150,9 @@
     // -----------------------------------------------------------------------
     //  Protected virtual methods.
     // -----------------------------------------------------------------------
+#ifdef OS390
+    friend class Uniconv390TransService;
+#endif
     virtual XMLTranscoder* makeNewXMLTranscoder
     (
         const   XMLCh* const            encodingName

Modified: xerces/c/trunk/src/xercesc/util/Transcoders/Uniconv390/Uniconv390TransService.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/Transcoders/Uniconv390/Uniconv390TransService.cpp?view=diff&rev=499946&r1=499945&r2=499946
==============================================================================
--- xerces/c/trunk/src/xercesc/util/Transcoders/Uniconv390/Uniconv390TransService.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/Transcoders/Uniconv390/Uniconv390TransService.cpp Thu Jan 25 12:19:47 2007
@@ -191,7 +191,10 @@
    fCaseConverter->ftolowerhand=UNICONV_NOHANDLE;
 }
 
-   fICUService = new ICUTransService;
+   if ((gForceTranscode == MUST_USE_ICU) |
+       (gForceTranscode == MUST_USE_ICU_SRC_OFFS)) {
+         XMLPlatformUtils::fgTransService2 = new ICUTransService;
+   }
 
    gViewTranscoder = false;
    if ( !strcmp(getenv("_IXM_VIEW_CONVERSION"),"YES") )
@@ -218,8 +221,8 @@
       delete fCaseConverter;
       fCaseConverter=0;
    }
-   if (fICUService) {
-    delete  fICUService;
+   if (XMLPlatformUtils::fgTransService2) {
+    delete  XMLPlatformUtils::fgTransService2;
    }
 }
 
@@ -277,7 +280,13 @@
    }
    // check if unicode services does not support upper casing again, then call ICU.
    if (fCaseConverter->ftoupperhand == UNICONV_ERROR) {
-      return fICUService->compareIString(comp1,comp2);
+      if (!XMLPlatformUtils::fgTransService2) {
+         XMLMutexLock lockConverter(&fCaseConverter->fcaseMutex);
+         if (!XMLPlatformUtils::fgTransService2) {
+            XMLPlatformUtils::fgTransService2 = new ICUTransService;
+         }
+      }
+      return XMLPlatformUtils::fgTransService2->compareIString(comp1,comp2);
    }
    return 0;
 }
@@ -343,7 +352,13 @@
    }
    // check if unicode services does not support upper casing, then call ICU.
    if (fCaseConverter->ftoupperhand == UNICONV_ERROR) {
-      return fICUService->compareNIString(comp1,comp2,maxChars);
+      if (!XMLPlatformUtils::fgTransService2) {
+         XMLMutexLock lockConverter(&fCaseConverter->fcaseMutex);
+         if (!XMLPlatformUtils::fgTransService2) {
+            XMLPlatformUtils::fgTransService2 = new ICUTransService;
+         }
+      }
+      return XMLPlatformUtils::fgTransService2->compareNIString(comp1,comp2,maxChars);
    }
    return 0;
 }
@@ -391,7 +406,13 @@
       }
    }
    if (fCaseConverter->ftoupperhand==UNICONV_ERROR) {
-     return fICUService->upperCase(toUpperCase);
+     if (!XMLPlatformUtils::fgTransService2) {
+          XMLMutexLock lockConverter(&fCaseConverter->fcaseMutex);
+          if (!XMLPlatformUtils::fgTransService2) {
+             XMLPlatformUtils::fgTransService2 = new ICUTransService;
+          }
+     }
+     return XMLPlatformUtils::fgTransService2->upperCase(toUpperCase);
    }
 }
 
@@ -426,7 +447,13 @@
       }
    }
    if (fCaseConverter->ftolowerhand==UNICONV_ERROR) {
-     return fICUService->lowerCase(toLowerCase);
+     if (!XMLPlatformUtils::fgTransService2) {
+        XMLMutexLock lockConverter(&fCaseConverter->fcaseMutex);
+        if (!XMLPlatformUtils::fgTransService2) {
+           XMLPlatformUtils::fgTransService2 = new ICUTransService;
+        }
+     }
+     return XMLPlatformUtils::fgTransService2->lowerCase(toLowerCase);
    }
 }
 
@@ -439,7 +466,13 @@
        (gForceTranscode == MUST_USE_ICU_SRC_OFFS)) {
       if (gViewTranscoder)
          printf("IXM1004I LCP - Using ICU - %s\n",nl_langinfo(CODESET));
-      fLCPTranscoder = fICUService->makeNewLCPTranscoder();
+      if (!XMLPlatformUtils::fgTransService2) {
+         XMLMutexLock lockConverter(&fCaseConverter->fcaseMutex);
+         if (!XMLPlatformUtils::fgTransService2) {
+            XMLPlatformUtils::fgTransService2 = new ICUTransService;
+         }
+      }
+      fLCPTranscoder = XMLPlatformUtils::fgTransService2->makeNewLCPTranscoder();
    } else {
       char codepage[32];
       sprintf(codepage,"%s-s390", nl_langinfo(CODESET));
@@ -454,7 +487,13 @@
          if (gForceTranscode != MUST_USE_UNICONV) {
             if (gViewTranscoder)
                printf("IXM1006I LCP - Using ICU - %s\n",nl_langinfo(CODESET));
-            fLCPTranscoder = fICUService->makeNewLCPTranscoder();
+            if (!XMLPlatformUtils::fgTransService2) {
+               XMLMutexLock lockConverter(&fCaseConverter->fcaseMutex);
+               if (!XMLPlatformUtils::fgTransService2) {
+                  XMLPlatformUtils::fgTransService2 = new ICUTransService;
+               }
+            }
+            fLCPTranscoder = XMLPlatformUtils::fgTransService2->makeNewLCPTranscoder();
          }
       }
    }
@@ -478,7 +517,13 @@
        (gForceTranscode == MUST_USE_ICU_SRC_OFFS)) {
       if (gViewTranscoder)
          printf("IXM1001I XML - Using ICU - %s\n",localname);
-      return fICUService->makeNewXMLTranscoder(encodingName,resValue,blockSize, manager);
+      if (!XMLPlatformUtils::fgTransService2) {
+         XMLMutexLock lockConverter(&fCaseConverter->fcaseMutex);
+         if (!XMLPlatformUtils::fgTransService2) {
+            XMLPlatformUtils::fgTransService2 = new ICUTransService;
+         }
+      }
+      return XMLPlatformUtils::fgTransService2->makeNewXMLTranscoder(encodingName,resValue,blockSize, manager);
    }
 
    uniconvconverter *tconv=addConverter(localname,resValue);
@@ -490,7 +535,13 @@
       else {
          if (gViewTranscoder)
             printf("IXM1002I XML - Using ICU - %s\n",localname);
-         return fICUService->makeNewXMLTranscoder(encodingName,resValue,blockSize, manager);
+         if (!XMLPlatformUtils::fgTransService2) {
+            XMLMutexLock lockConverter(&fCaseConverter->fcaseMutex);
+            if (!XMLPlatformUtils::fgTransService2) {
+               XMLPlatformUtils::fgTransService2 = new ICUTransService;
+            }
+         }
+         return XMLPlatformUtils::fgTransService2->makeNewXMLTranscoder(encodingName,resValue,blockSize, manager);
       }
    }
 
@@ -745,6 +796,15 @@
                , false
            )
        );
+       gMappings->put
+       (
+   		(void*)XMLUni::fgUCS4EncodingString4,
+           new EEndianNameMapFor<XMLUCS4Transcoder>
+           (
+               XMLUni::fgUCS4EncodingString4
+               , false
+           )
+       );
 
        //
        //  Add in our mappings for IBM037, and the one alias we support for
@@ -1008,6 +1068,15 @@
            new EEndianNameMapFor<XMLUCS4Transcoder>
            (
                XMLUni::fgUCS4EncodingString3
+               , false
+           )
+       );
+       gMappings->put
+       (
+   		(void*)XMLUni::fgUCS4EncodingString4,
+           new EEndianNameMapFor<XMLUCS4Transcoder>
+           (
+               XMLUni::fgUCS4EncodingString4
                , false
            )
        );

Modified: xerces/c/trunk/src/xercesc/util/XMLUni.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/XMLUni.cpp?view=diff&rev=499946&r1=499945&r2=499946
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLUni.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLUni.cpp Thu Jan 25 12:19:47 2007
@@ -356,6 +356,11 @@
     chLatin_U, chLatin_C, chLatin_S, chUnderscore, chDigit_4, chNull
 };
 
+const XMLCh XMLUni::fgUCS4EncodingString4[] =
+{
+    chLatin_U, chLatin_T, chLatin_F, chDash, chDigit_3, chDigit_2, chNull
+};
+
 const XMLCh XMLUni::fgUCS4BEncodingString[] =
 {
     chLatin_U, chLatin_C, chLatin_S, chDash, chDigit_4, chSpace, chOpenParen, chLatin_B, chLatin_E, chCloseParen, chNull

Modified: xerces/c/trunk/src/xercesc/util/XMLUni.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/XMLUni.hpp?view=diff&rev=499946&r1=499945&r2=499946
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLUni.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLUni.hpp Thu Jan 25 12:19:47 2007
@@ -105,6 +105,7 @@
     static const XMLCh fgUCS4EncodingString[];
     static const XMLCh fgUCS4EncodingString2[];
     static const XMLCh fgUCS4EncodingString3[];
+    static const XMLCh fgUCS4EncodingString4[];
     static const XMLCh fgUCS4BEncodingString[];
     static const XMLCh fgUCS4BEncodingString2[];
     static const XMLCh fgUCS4LEncodingString[];

Modified: xerces/c/trunk/src/xercesc/validators/schema/TraverseSchema.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/validators/schema/TraverseSchema.cpp?view=diff&rev=499946&r1=499945&r2=499946
==============================================================================
--- xerces/c/trunk/src/xercesc/validators/schema/TraverseSchema.cpp (original)
+++ xerces/c/trunk/src/xercesc/validators/schema/TraverseSchema.cpp Thu Jan 25 12:19:47 2007
@@ -1012,6 +1012,7 @@
     for (; child != 0; child = XUtil::getNextSiblingElement(child)) {
         contentSpecNode.release();
         bool seeParticle = false;
+        bool wasAny = false;
         const XMLCh* childName = child->getLocalName();
 
         if (XMLString::equals(childName, SchemaSymbols::fgELT_ELEMENT)) {
@@ -1065,6 +1066,7 @@
 
             contentSpecNode.reset(traverseAny(child));
             seeParticle = true;
+            wasAny = true;
         }
         else {
             reportSchemaError(child, XMLUni::fgValidityDomain, XMLValid::GroupContentRestricted, childName);
@@ -1076,6 +1078,9 @@
 
         if (seeParticle) {
             checkMinMax(contentSpecNode.get(), child, Not_All_Context);
+            if (wasAny && contentSpecNode.get()->getMaxOccurs() == 0) {
+                contentSpecNode.reset(0);
+            }
         }
 
         if (left.get() == 0) {
@@ -2625,7 +2630,10 @@
 
     // check annotation
     const DOMElement* content = checkContent(elem, XUtil::getFirstChildElement(elem), true);    
-    if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size())
+    // Put annotations on all elements for the situation where there is a group of
+    // elements and not all have annotations.
+    //if (fScanner->getGenerateSyntheticAnnotations() && !fAnnotation && fNonXSAttList->size())
+    if (!fAnnotation && fScanner->getGenerateSyntheticAnnotations())
     {
         fAnnotation = generateSyntheticAnnotation(elem, fNonXSAttList);        
     }
@@ -5566,10 +5574,15 @@
     // that is, make sure that the type we're deriving has some relatoinship
     // to substitutionGroupElt's type.
     else if (typeInfo) { // do complexType case ...need testing
+        
+        ComplexTypeInfo* subsTypeInfo = subsElemDecl->getComplexTypeInfo();
+
+        if (subsTypeInfo == typeInfo)
+            return true;
 
         int derivationMethod = typeInfo->getDerivedBy();
 
-        if (typeInfo->getContentType() == SchemaElementDecl::Simple) {  // take care of complexType based on simpleType case...
+        if (subsTypeInfo == 0) {  // take care of complexType based on simpleType case...
 
             DatatypeValidator* elemDV = typeInfo->getDatatypeValidator();
             DatatypeValidator* subsValidator = subsElemDecl->getDatatypeValidator();
@@ -5588,11 +5601,6 @@
         }
         else { // complex content
 
-            ComplexTypeInfo* subsTypeInfo = subsElemDecl->getComplexTypeInfo();
-
-            if (subsTypeInfo == typeInfo)
-                return true;
-
             const ComplexTypeInfo* elemTypeInfo = typeInfo;
 
             for (; elemTypeInfo && elemTypeInfo != subsTypeInfo;
@@ -5611,15 +5619,17 @@
     }
     else if (validator) { // do simpleType case...
 
-        // first, check for type relation.
-        DatatypeValidator* subsValidator = subsElemDecl->getDatatypeValidator();
+        if (!subsElemDecl->getComplexTypeInfo()) {
+            // first, check for type relation.
+            DatatypeValidator* subsValidator = subsElemDecl->getDatatypeValidator();
 
-        if (subsValidator == validator) {
-            return true;
-        }
-        else if (subsValidator && subsValidator->isSubstitutableBy(validator)
-            && ((subsElemDecl->getFinalSet() & SchemaSymbols::XSD_RESTRICTION) == 0)) {
+            if (subsValidator == validator) {
+                return true;
+            }
+            else if (subsValidator && subsValidator->isSubstitutableBy(validator)
+                && ((subsElemDecl->getFinalSet() & SchemaSymbols::XSD_RESTRICTION) == 0)) {
                 return true;
+            }
         }
     }
     else // validator==0 && typeInfo==0 -- no checking
@@ -6304,7 +6314,15 @@
         }
     }
     else if (typeInfo->getContentSpec() == 0) {
-        typeInfo->setContentType(SchemaElementDecl::Empty);
+        if ((typeDerivedBy == SchemaSymbols::XSD_EXTENSION) &&
+             baseTypeInfo) {
+            typeInfo->setBaseDatatypeValidator(baseTypeInfo->getBaseDatatypeValidator());
+            typeInfo->setDatatypeValidator(baseTypeInfo->getDatatypeValidator());
+            typeInfo->setContentType(baseTypeInfo->getContentType());
+        }
+        else {
+            typeInfo->setContentType(SchemaElementDecl::Empty);
+        }
     }
     else {
         typeInfo->setContentType(SchemaElementDecl::Children);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org