ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1171118 - /webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaSerializer.java
Date Thu, 15 Sep 2011 14:48:20 GMT
Author: dkulp
Date: Thu Sep 15 14:48:19 2011
New Revision: 1171118

URL: http://svn.apache.org/viewvc?rev=1171118&view=rev
Log:
[XMLSCHEMA-10] Fix issues with attributes being written out before the facets
Patch from William Eliot Kimber applied
(also fix stuff I shouldn't have committed in my last commit...  need to switch
my XmlSchema checkout to git.....)

Modified:
    webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaSerializer.java

Modified: webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaSerializer.java
URL: http://svn.apache.org/viewvc/webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaSerializer.java?rev=1171118&r1=1171117&r2=1171118&view=diff
==============================================================================
--- webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaSerializer.java
(original)
+++ webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaSerializer.java
Thu Sep 15 14:48:19 2011
@@ -613,13 +613,13 @@ public class XmlSchemaSerializer {
             choice.appendChild(annotation);
         }
 
-        List<XmlSchemaChoiceMember> itemColl = choiceObj.getItems();
+        List<XmlSchemaObject> itemColl = choiceObj.getItems();
 
         if (itemColl != null) {
             int itemLength = itemColl.size();
 
             for (int i = 0; i < itemLength; i++) {
-                XmlSchemaChoiceMember obj = itemColl.get(i);
+                XmlSchemaObject obj = itemColl.get(i);
 
                 if (obj instanceof XmlSchemaElement) {
                     Element el = serializeElement(doc, (XmlSchemaElement)obj, schema);
@@ -1910,6 +1910,16 @@ public class XmlSchemaSerializer {
             Element annotation = serializeAnnotation(doc, restrictionObj.getAnnotation(),
schema);
             restriction.appendChild(annotation);
         }
+        if (restrictionObj.getBaseType() != null) {
+            Element inlineSimpleType = serializeSimpleType(doc, restrictionObj.getBaseType(),
schema);
+            restriction.appendChild(inlineSimpleType);
+        }
+        List<XmlSchemaFacet> facets = restrictionObj.getFacets();
+        int facetLength = facets.size();
+        for (int i = 0; i < facetLength; i++) {
+            Element facet = serializeFacet(doc, facets.get(i), schema);
+            restriction.appendChild(facet);
+        }
         int attrCollLength = restrictionObj.getAttributes().size();
         for (int i = 0; i < attrCollLength; i++) {
             XmlSchemaAnnotated obj = restrictionObj.getAttributes().get(i);
@@ -1923,20 +1933,10 @@ public class XmlSchemaSerializer {
                 restriction.appendChild(attributeGroup);
             }
         }
-        if (restrictionObj.getBaseType() != null) {
-            Element inlineSimpleType = serializeSimpleType(doc, restrictionObj.getBaseType(),
schema);
-            restriction.appendChild(inlineSimpleType);
-        }
         if (restrictionObj.anyAttribute != null) {
             Element anyAttribute = serializeAnyAttribute(doc, restrictionObj.anyAttribute,
schema);
             restriction.appendChild(anyAttribute);
         }
-        List<XmlSchemaFacet> facets = restrictionObj.getFacets();
-        int facetLength = facets.size();
-        for (int i = 0; i < facetLength; i++) {
-            Element facet = serializeFacet(doc, facets.get(i), schema);
-            restriction.appendChild(facet);
-        }
 
         // process extension
         processExtensibilityComponents(restrictionObj, restriction);



Mime
View raw message