diff --git a/src/xercesc/validators/schema/SchemaElementDecl.hpp b/src/xercesc/validators/schema/SchemaElementDecl.hpp
index 82fc9d4ae5cc1f4489f35104bc5532ffaed75fc5..142fcefda0afcbe1e56121f01fcab56da337072d 100644
--- a/src/xercesc/validators/schema/SchemaElementDecl.hpp
+++ b/src/xercesc/validators/schema/SchemaElementDecl.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.3  2002/03/04 15:09:50  knoaman
+ * Fix for bug 6834.
+ *
  * Revision 1.2  2002/02/06 22:30:50  knoaman
  * Added a new attribute to store the wild card information for elements of type 'anyType'.
  *
@@ -385,6 +388,10 @@ inline SchemaElementDecl::ModelTypes SchemaElementDecl::getModelType() const
 
 inline DatatypeValidator* SchemaElementDecl::getDatatypeValidator() const
 {
+    if (fXsiComplexTypeInfo) {
+        return fXsiComplexTypeInfo->getDatatypeValidator();
+    }
+
     return fDatatypeValidator;
 }