Author: sandygao
Date: Mon Oct  5 17:42:57 2009
New Revision: 821931

URL: http://svn.apache.org/viewvc?rev=821931&view=rev
Log:
Remember the type name when it can't be resolved to a type definition.

Modified:
    xerces/java/trunk/src/org/apache/xerces/impl/xs/XSAttributeDecl.java
    xerces/java/trunk/src/org/apache/xerces/impl/xs/XSElementDecl.java
    
xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDAttributeTraverser.java
    
xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDElementTraverser.java

Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/XSAttributeDecl.java
URL: 
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/XSAttributeDecl.java?rev=821931&r1=821930&r2=821931&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xs/XSAttributeDecl.java 
(original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xs/XSAttributeDecl.java Mon 
Oct  5 17:42:57 2009
@@ -20,6 +20,7 @@
 import org.apache.xerces.impl.dv.ValidatedInfo;
 import org.apache.xerces.impl.dv.XSSimpleType;
 import org.apache.xerces.impl.xs.util.XSObjectListImpl;
+import org.apache.xerces.xni.QName;
 import org.apache.xerces.xs.ShortList;
 import org.apache.xerces.xs.XSAnnotation;
 import org.apache.xerces.xs.XSAttributeDeclaration;
@@ -52,6 +53,7 @@
     String fTargetNamespace = null;
     // the simple type of the attribute
     XSSimpleType fType = null;
+    public QName fUnresolvedTypeName = null;
     // value constraint type: default, fixed or !specified
     short fConstraintType = XSConstants.VC_NONE;
     // scope
@@ -84,6 +86,7 @@
         fName = null;
         fTargetNamespace = null;
         fType = null;
+        fUnresolvedTypeName = null;
         fConstraintType = XSConstants.VC_NONE;
         fScope = XSConstants.SCOPE_ABSENT;
         fDefault = null;

Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/XSElementDecl.java
URL: 
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/XSElementDecl.java?rev=821931&r1=821930&r2=821931&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xs/XSElementDecl.java 
(original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xs/XSElementDecl.java Mon Oct  
5 17:42:57 2009
@@ -21,6 +21,7 @@
 import org.apache.xerces.impl.xs.identity.IdentityConstraint;
 import org.apache.xerces.impl.xs.util.XSNamedMapImpl;
 import org.apache.xerces.impl.xs.util.XSObjectListImpl;
+import org.apache.xerces.xni.QName;
 import org.apache.xerces.xs.ShortList;
 import org.apache.xerces.xs.XSAnnotation;
 import org.apache.xerces.xs.XSComplexTypeDefinition;
@@ -54,6 +55,7 @@
     public String fTargetNamespace = null;
     // type of the element
     public XSTypeDefinition fType = null;
+    public QName fUnresolvedTypeName = null;
     // misc flag of the element: nillable/abstract/fixed
     short fMiscFlags = 0;
     public short fScope = XSConstants.SCOPE_ABSENT;
@@ -174,6 +176,7 @@
         fName = null;
         fTargetNamespace = null;
         fType = null;
+        fUnresolvedTypeName = null;
         fMiscFlags = 0;
         fBlock = XSConstants.DERIVATION_NONE;
         fFinal = XSConstants.DERIVATION_NONE;

Modified: 
xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDAttributeTraverser.java
URL: 
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDAttributeTraverser.java?rev=821931&r1=821930&r2=821931&view=diff
==============================================================================
--- 
xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDAttributeTraverser.java
 (original)
+++ 
xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDAttributeTraverser.java
 Mon Oct  5 17:42:57 2009
@@ -322,10 +322,15 @@
         // Handle type attribute
         if (attrType == null && typeAtt != null) {
             XSTypeDefinition type = 
(XSTypeDefinition)fSchemaHandler.getGlobalDecl(schemaDoc, 
XSDHandler.TYPEDECL_TYPE, typeAtt, attrDecl);
-            if (type != null && type.getTypeCategory() == 
XSTypeDefinition.SIMPLE_TYPE)
+            if (type != null && type.getTypeCategory() == 
XSTypeDefinition.SIMPLE_TYPE) {
                 attrType = (XSSimpleType)type;
-            else
+            }
+            else {
                 reportSchemaError("src-resolve", new Object[]{typeAtt.rawname, 
"simpleType definition"}, attrDecl);
+                if (type == null) {
+                       attribute.fUnresolvedTypeName = typeAtt;
+                }
+            }
         }
         
         if (attrType == null) {

Modified: 
xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDElementTraverser.java
URL: 
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDElementTraverser.java?rev=821931&r1=821930&r2=821931&view=diff
==============================================================================
--- 
xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDElementTraverser.java
 (original)
+++ 
xerces/java/trunk/src/org/apache/xerces/impl/xs/traversers/XSDElementTraverser.java
 Mon Oct  5 17:42:57 2009
@@ -379,6 +379,9 @@
         // Handler type attribute
         if (elementType == null && typeAtt != null) {
             elementType = 
(XSTypeDefinition)fSchemaHandler.getGlobalDecl(schemaDoc, 
XSDHandler.TYPEDECL_TYPE, typeAtt, elmDecl);
+            if (elementType == null) {
+                element.fUnresolvedTypeName = typeAtt;
+            }
         }
         
         // Get it from the substitutionGroup declaration



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to