XMLBEANS-531: Fix schema gen of attributes

git-svn-id: https://svn.apache.org/repos/asf/xmlbeans/trunk@1851655 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/CHANGES.txt b/CHANGES.txt
index 1ce0ea8..6610191 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,6 @@
 Changes in V3.0.3 since V3.0.2
 
+* XMLBEANS-531: Fix schema gen of attributes
 * XMLBEANS-530: Allow namespaces of XmlOptions to be passed to the XQuery engine
 * XMLBEANS-529: Format xmlobjects to the correct string representation on XPath access
 * XMLBEANS-528: Allow document locator to be set after initialization
diff --git a/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java b/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
index 0e6e20c..57a2805 100644
--- a/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
+++ b/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
@@ -2314,7 +2314,7 @@
             printJavaDoc((several ? "Sets first " : "Sets the ") + propdesc);
             emit("public void set" + propertyName + "(" + type + " " + safeVarName + ")");
             startBlock();
-            if ( xmltype && !isSubstGroup )
+            if ( xmltype && !isSubstGroup && !isAttr )
             {
                 emitPre(sType, PrePostExtension.OPERATION_SET, identifier, isAttr, several ? "0" : "-1");
                 emit("generatedSetterHelperImpl(" + safeVarName + ", " + setIdentifier + ", 0, " +