You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by kn...@apache.org on 2009/12/10 19:46:05 UTC

svn commit: r889362 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java

Author: knoaman
Date: Thu Dec 10 18:46:04 2009
New Revision: 889362

URL: http://svn.apache.org/viewvc?rev=889362&view=rev
Log:
Fix a problem with CTA checking when handling root elements.

Modified:
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=889362&r1=889361&r2=889362&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Thu Dec 10 18:46:04 2009
@@ -2168,7 +2168,32 @@
                 processRootTypeQName(fRootTypeQName);
             }
         }
-             
+        
+        // if there was no processor stipulated type
+        if (fCurrentType == null) {
+            // try again to get the element decl:
+            // case 1: find declaration for root element
+            // case 2: find declaration for element from another namespace
+            if (fCurrentElemDecl == null) {
+                // try to find schema grammar by different means..
+                SchemaGrammar sGrammar =
+                    findSchemaGrammar(
+                        XSDDescription.CONTEXT_ELEMENT,
+                        element.uri,
+                        null,
+                        element,
+                        attributes);
+                if (sGrammar != null) {
+                    fCurrentElemDecl = sGrammar.getGlobalElementDecl(element.localpart);
+                }
+            }
+            
+            if (fCurrentElemDecl != null) {
+                // then get the type
+                fCurrentType = fCurrentElemDecl.fType;
+            }
+        }
+
         //process type alternatives
         if (fTypeAlternativesChecking && fCurrentElemDecl != null) {
             boolean typeSelected = false;
@@ -2196,31 +2221,6 @@
                 }
             }            
         }
-        
-        // if there was no processor stipulated type
-        if (fCurrentType == null) {
-            // try again to get the element decl:
-            // case 1: find declaration for root element
-            // case 2: find declaration for element from another namespace
-            if (fCurrentElemDecl == null) {
-                // try to find schema grammar by different means..
-                SchemaGrammar sGrammar =
-                    findSchemaGrammar(
-                        XSDDescription.CONTEXT_ELEMENT,
-                        element.uri,
-                        null,
-                        element,
-                        attributes);
-                if (sGrammar != null) {
-                    fCurrentElemDecl = sGrammar.getGlobalElementDecl(element.localpart);
-                }
-            }
-            
-            if (fCurrentElemDecl != null) {
-                // then get the type
-                fCurrentType = fCurrentElemDecl.fType;
-            }
-        }
 
         // check if we should be ignoring xsi:type on this element
         if (fElementDepth == fIgnoreXSITypeDepth && fCurrentElemDecl == null) {



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