You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by aj...@apache.org on 2006/04/21 17:55:11 UTC

svn commit: r395921 - /webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/XmlSchemaSerializer.java

Author: ajith
Date: Fri Apr 21 08:55:10 2006
New Revision: 395921

URL: http://svn.apache.org/viewcvs?rev=395921&view=rev
Log:
1. Annotations are serialized twice for the enums (and other facets). Fixed that issue.
2. Annotations in group serialization had a problem with the order! fixed that too

Modified:
    webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/XmlSchemaSerializer.java

Modified: webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/XmlSchemaSerializer.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/XmlSchemaSerializer.java?rev=395921&r1=395920&r2=395921&view=diff
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/XmlSchemaSerializer.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/XmlSchemaSerializer.java Fri Apr 21 08:55:10 2006
@@ -801,11 +801,11 @@
 
         if (facetObj.id != null)
             serializedFacet.setAttribute("id", facetObj.id);
-        if (facetObj.annotation != null) {
-            Element annotation = serializeAnnotation(doc, facetObj.annotation,
-                                                     schema);
-            serializedFacet.appendChild(annotation);
-        }
+//        if (facetObj.annotation != null) {
+//            Element annotation = serializeAnnotation(doc, facetObj.annotation,
+//                                                     schema);
+//            serializedFacet.appendChild(annotation);
+//        }
 
         return serializedFacet;
     }
@@ -1457,6 +1457,12 @@
             throw new XmlSchemaSerializerException("Group must have " +
                                                    "name or ref");
 
+         /* annotations are supposed to be written first!!!!! */
+        if (groupObj.annotation != null) {
+            Element annotation = serializeAnnotation(doc,
+                                                     groupObj.annotation, schema);
+            group.appendChild(annotation);
+        }
 
         if (groupObj.particle instanceof XmlSchemaSequence) {
             Element sequence = serializeSequence(doc,
@@ -1471,11 +1477,7 @@
                                        (XmlSchemaAll) groupObj.particle, schema);
             group.appendChild(all);
         }
-        if (groupObj.annotation != null) {
-            Element annotation = serializeAnnotation(doc,
-                                                     groupObj.annotation, schema);
-            group.appendChild(annotation);
-        }
+
         return group;
     }