You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by dk...@apache.org on 2011/09/15 17:09:04 UTC
svn commit: r1171123 -
/webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/main/java/org/apache/ws/commons/schema/XmlSchemaSerializer.java
Author: dkulp
Date: Thu Sep 15 15:09:04 2011
New Revision: 1171123
URL: http://svn.apache.org/viewvc?rev=1171123&view=rev
Log:
[XMLSCHEMA-10] Fix issue of attributes being written before facets
Patch from William Eliot Kimber applied
Modified:
webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/main/java/org/apache/ws/commons/schema/XmlSchemaSerializer.java
Modified: webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/main/java/org/apache/ws/commons/schema/XmlSchemaSerializer.java
URL: http://svn.apache.org/viewvc/webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/main/java/org/apache/ws/commons/schema/XmlSchemaSerializer.java?rev=1171123&r1=1171122&r2=1171123&view=diff
==============================================================================
--- webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/main/java/org/apache/ws/commons/schema/XmlSchemaSerializer.java (original)
+++ webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/main/java/org/apache/ws/commons/schema/XmlSchemaSerializer.java Thu Sep 15 15:09:04 2011
@@ -2121,6 +2121,20 @@ public class XmlSchemaSerializer {
restrictionObj.annotation, schema);
restriction.appendChild(annotation);
}
+ if (restrictionObj.baseType != null) {
+ Element inlineSimpleType = serializeSimpleType(doc,
+ restrictionObj.baseType, schema);
+ restriction.appendChild(inlineSimpleType);
+ }
+ XmlSchemaObjectCollection facets = restrictionObj.facets;
+ int facetLength = facets.getCount();
+ for (int i = 0; i < facetLength; i++) {
+ Element facet = serializeFacet(doc,
+ (XmlSchemaFacet) facets.getItem(i), schema);
+ restriction.appendChild(facet);
+ }
+ // WEK: Moved attributes and anyAttributes to end where they
+ // are required to be.
int attrCollLength = restrictionObj.attributes.getCount();
for (int i = 0; i < attrCollLength; i++) {
XmlSchemaObject obj = restrictionObj.attributes.getItem(i);
@@ -2135,23 +2149,11 @@ public class XmlSchemaSerializer {
restriction.appendChild(attributeGroup);
}
}
- if (restrictionObj.baseType != null) {
- Element inlineSimpleType = serializeSimpleType(doc,
- restrictionObj.baseType, schema);
- restriction.appendChild(inlineSimpleType);
- }
if (restrictionObj.anyAttribute != null) {
Element anyAttribute = serializeAnyAttribute(doc,
restrictionObj.anyAttribute, schema);
restriction.appendChild(anyAttribute);
}
- XmlSchemaObjectCollection facets = restrictionObj.facets;
- int facetLength = facets.getCount();
- for (int i = 0; i < facetLength; i++) {
- Element facet = serializeFacet(doc,
- (XmlSchemaFacet) facets.getItem(i), schema);
- restriction.appendChild(facet);
- }
//process extension
processExtensibilityComponents(restrictionObj,restriction);