Author: dims
Date: Wed Sep 6 06:41:02 2006
New Revision: 440711
URL: http://svn.apache.org/viewvc?view=rev&rev=440711
Log:
- Fix extra xmlns="" in serialized schema
- Fix choice serialization for minOccurs/maxOccurs (they can be set to zero)
Modified:
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaSerializer.java
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/utils/NodeNamespaceContext.java
Modified:
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaSerializer.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaSerializer.java?view=diff&rev=440711&r1=440710&r2=440711
==============================================================================
---
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaSerializer.java
(original)
+++
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaSerializer.java
Wed Sep 6 06:41:02 2006
@@ -1146,7 +1146,7 @@
choice.setAttribute("id", choiceObj.id);
- if (choiceObj.maxOccurs < Long.MAX_VALUE && choiceObj.maxOccurs > 1)
+ if (choiceObj.maxOccurs < Long.MAX_VALUE && choiceObj.maxOccurs != 1)
choice.setAttribute("maxOccurs",
choiceObj.maxOccurs + "");
else if (choiceObj.maxOccurs == Long.MAX_VALUE)
@@ -1154,7 +1154,7 @@
"unbounded");
//else not serialized
- if (choiceObj.minOccurs > 1)
+ if (choiceObj.minOccurs != 1)
choice.setAttribute("minOccurs",
choiceObj.minOccurs + "");
Modified:
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/utils/NodeNamespaceContext.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/utils/NodeNamespaceContext.java?view=diff&rev=440711&r1=440710&r2=440711
==============================================================================
---
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/utils/NodeNamespaceContext.java
(original)
+++
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/utils/NodeNamespaceContext.java
Wed Sep 6 06:41:02 2006
@@ -49,7 +49,8 @@
private Map getDeclarations() {
if (declarations == null) {
declarations = new HashMap();
- declarations.put(Constants.DEFAULT_NS_PREFIX,
Constants.NULL_NS_URI);
+ //FIXME: Do we really need to add this mapping? shows up in the
serialized schema as xmlns=""
+ //declarations.put(Constants.DEFAULT_NS_PREFIX,
Constants.NULL_NS_URI);
new PrefixCollector(){
protected void declare(String pPrefix, String pNamespaceURI) {
declarations.put(pPrefix, pNamespaceURI);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]