How to pass null values in an XML request
- Last Updated: July 31, 2024
- 1 minute read
- Corticon
- Documentation
Passing a null value to any Corticon Server using XML payloads is accomplished in the following ways:
| Vocabulary Type | Passing a null in an XML message |
|---|---|
| An attribute of any type | Omit the XML tag for the attribute, or use the XSD
special value of xsi:nil='1' as the
attribute's value. |
| An attribute except String types | Include the XML tag for the attribute but do not
follow it with a value, for example, <weight></weight> or simply <weight/>. If the type is String, this
form is treated as an empty string (a string of length zero, which is not
the same as null). |
| An association | Do not include an href to a potentially associable Entity (Flat model) or do
not include the potentially associable role in a nested child
relationship to its parent. |
| An entity | Omit the complexType from the payload entirely. |
XML Payloads with null values created by Rules
When Rules set a null value that propagates into the payload of a request, XML treats the null as follows
Assume that the incoming payload is...
Person
Age : 45
Name : Jack
... and that rule processing sets Age =
null.
The output would remove
Age from the
payload like this: Person
Name : Jack