I have an application with a REST style interface that takes XML documents via POST from clients. This application is written in Java and uses XML beans to process the posted message.
The XML schema definition for a field in the message looks like this:
<xs:element name='value' type='xs:string' nillable='true' />
How do I send a null value that meets this spec?
I sent <value xsi:nil='true' /> but this caused the XML parser to barf.
That’s the right way of sending a nil value (assuming that the default namespace and the
xsinamespace are set to the correct values, namely'http://www.w3.org/2001/XMLSchema-instance'forxsi.) so it looks like you might have come up against a bug in the CML parser you’re using. What’s the error message?You might try using
xsi:nil='1'or using separate open and close tags (<value xsi:nil='true'></value>) to try working around the bug.