You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rampart-c-dev@ws.apache.org by Patrick Cosmo <pc...@incognito.com> on 2010/05/13 17:56:00 UTC

Axis is_nil methods ..

Hello,

We notice that the Axis generated "is_<elementName>_nil" methods will return AXIS2_TRUE if an element is not supplied at all (even if this value is not defined as being nillable in the XSD). Is this a bug?

My understanding is that an isNil method for XML should only return true if:

an element was provided in the XML without content and with the xsi:isnil="true" attribute set.

Other XML libraries (JaxB, Apache) seem provide a definition of is_nil that conforms to this definition, I've provided some reference below.

If this is a bug, would there by any objects to my fixing this problem and providing Axis code diffs that implement the generated is_nil methods to only return AXIS2_TRUE when the above condition is met.

The Jaxb library documents this for nil (http://72.5.124.55/javaee/6/docs/api/javax/xml/bind/JAXBElement.html):

boolean isNil()
          Returns true iff this element instance content model is nil.

protected  boolean nil
          true iff the xml element instance has xsi:nil="true".

and the Apache library documents there "isNil" method as follows (http://xmlbeans.apache.org/docs/2.0.0/reference/org/apache/xmlbeans/XmlObject.html):

isNil
public boolean isNil()

True if the value is nil. Note that in order to be nil, the value must be in an element, and the element containing the value must be marked as nillable in the schema.


thanks,

Patrick Cosmo
Incognito Software Inc.
Senior Software Design Engineer
T: +1(604)678-2855
F: +1(604)688-4339
E: pcosmo@incognito.com
www.incognito.com




http://www.incognito.com/uc

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: c-dev-help@axis.apache.org