You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlbeans.apache.org by ra...@apache.org on 2008/03/25 19:47:04 UTC

svn commit: r640939 - /xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscComplexTypeResolver.java

Author: radup
Date: Tue Mar 25 11:47:02 2008
New Revision: 640939

URL: http://svn.apache.org/viewvc?rev=640939&view=rev
Log:
Fix for XMLBEANS-356 SchemaTypeLoaderException: Simple type does not have a recognized variety

Modified:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscComplexTypeResolver.java

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscComplexTypeResolver.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscComplexTypeResolver.java?rev=640939&r1=640938&r2=640939&view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscComplexTypeResolver.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscComplexTypeResolver.java Tue Mar 25 11:47:02 2008
@@ -551,8 +551,8 @@
         Group parseEg = getContentModel(parseTree);
 
         if (baseType != null &&
-            (baseType.getContentType() == SchemaType.SIMPLE_CONTENT) &&
-             parseEg != null)
+            (baseType.getContentType() == SchemaType.SIMPLE_CONTENT))
+        if (parseEg != null)
         {
             // if this type has complexContent, baseType is complexType
             // but with non-empty simpleContent then this type cannot
@@ -562,6 +562,12 @@
                 parseTree.xgetBase());
             baseType = null; // recovery: no inheritance.
         }
+        else
+        {
+            // No extra elements, the type is a complex type with simple content
+            resolveScExtensionPart2(sImpl, baseType, parseTree, targetNamespace, chameleon);
+            return;
+        }
 
         // build extension model
         SchemaParticle extensionModel = translateContentModel(sImpl,
@@ -832,6 +838,12 @@
             // recovery: just keep going
         }
 
+        resolveScExtensionPart2(sImpl, baseType, parseTree, targetNamespace, chameleon);
+    }
+
+    static void resolveScExtensionPart2(SchemaTypeImpl sImpl, SchemaType baseType, ExtensionType parseTree,
+        String targetNamespace, boolean chameleon)
+    {
         // build attr model and anonymous types
         List anonymousTypes = new ArrayList();
         SchemaAttributeModelImpl attrModel;



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