Author: mrglavas
Date: Fri Jun 30 20:52:16 2006
New Revision: 418433

URL: http://svn.apache.org/viewvc?rev=418433&view=rev
Log:
Fixing a bug in the processing of default attributes. If two or more defaulted 
attributes
have the same local name it was possible for them to overwrite each other.

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=418433&r1=418432&r2=418433&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 
Jun 30 20:52:16 2006
@@ -3018,15 +3018,20 @@
                 attName =
                     new QName(null, currDecl.fName, currDecl.fName, 
currDecl.fTargetNamespace);
                 String normalized = (defaultValue != null) ? 
defaultValue.stringValue() : "";
-                int attrIndex = attributes.addAttribute(attName, "CDATA", 
normalized);
+                int attrIndex;
                 if (attributes instanceof XMLAttributesImpl) {
                     XMLAttributesImpl attrs = (XMLAttributesImpl) attributes;
+                    attrIndex = attrs.getLength();
+                    attrs.addAttributeNS(attName, "CDATA", normalized);
                     boolean schemaId =
                         defaultValue != null
                             && defaultValue.memberType != null
                                 ? defaultValue.memberType.isIDType()
                                 : currDecl.fType.isIDType();
                     attrs.setSchemaId(attrIndex, schemaId);
+                }
+                else {
+                    attrIndex = attributes.addAttribute(attName, "CDATA", 
normalized);
                 }
 
                 if (fAugPSVI) {



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to