You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2007/11/02 22:05:14 UTC

svn commit: r591460 - /xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java

Author: mrglavas
Date: Fri Nov  2 14:05:14 2007
New Revision: 591460

URL: http://svn.apache.org/viewvc?rev=591460&view=rev
Log:
When reporting the error for the attribute call getTypeName() instead of getName().
The latter always returns null when the type is anonymous which isn't very useful
to be reporting in an error message.

Modified:
    xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java

Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=591460&r1=591459&r2=591460&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Fri Nov  2 14:05:14 2007
@@ -32,6 +32,7 @@
 import org.apache.xerces.impl.dv.InvalidDatatypeValueException;
 import org.apache.xerces.impl.dv.ValidatedInfo;
 import org.apache.xerces.impl.dv.XSSimpleType;
+import org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl;
 import org.apache.xerces.impl.validation.ConfigurableValidationState;
 import org.apache.xerces.impl.validation.ValidationManager;
 import org.apache.xerces.impl.validation.ValidationState;
@@ -2870,11 +2871,14 @@
                     fNotation = grammar.getGlobalNotationDecl(qName.localpart);
                 }
             }
-        } catch (InvalidDatatypeValueException idve) {
+        } 
+        catch (InvalidDatatypeValueException idve) {
             reportSchemaError(idve.getKey(), idve.getArgs());
             reportSchemaError(
                 "cvc-attribute.3",
-                new Object[] { element.rawname, fTempQName.rawname, attrValue, attDV.getName()});
+                new Object[] { element.rawname, fTempQName.rawname, attrValue, 
+                        (attDV instanceof XSSimpleTypeDecl) ? 
+                                ((XSSimpleTypeDecl) attDV).getTypeName() : attDV.getName()});
         }
 
         // get the value constraint from use or decl



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