[jboss-dev-forums] [JBoss XML Binding Development] New message: "Re: Regression moving to JBossXB 2.0.2.Beta5"

Alexey Loubyansky do-not-reply at jboss.com
Thu Mar 18 04:24:37 EDT 2010


JBoss development,

A new message was posted in the thread "Regression moving to JBossXB 2.0.2.Beta5":

http://community.jboss.org/message/532711#532711

Author  : Alexey Loubyansky
Profile : http://community.jboss.org/people/alex.loubyansky@jboss.com

Message:
--------------------------------------------------------------
The problem is the root element in your testcase is not nillable. If I change the element declaration above to
 
<xsd:element name='root' nillable='false'>
 
the nil attribute will be ignored during unmarshalling.
The root element creation happens in http://anonsvn.jboss.org/repos/jbossws/stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/SchemaBindingBuilder.java
method bindParameterToElement(SchemaBinding schemaBinding, QName xmlName, QName xmlType)
The line is schemaBinding.addElement(xmlName, typeBinding);
This will create and return newly created root element. But it's not made nillable by default. Which kind of makes sense as the default, since by default nillable in XSD and binding annotations is false.
Can you consider adding a line there to make it nillable? E.g.
 
ElementBinding e = schemaBinding.addElement(xmlName, typeBinding);
e.setNillable(true);

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/532711#532711




More information about the jboss-dev-forums mailing list