When writing XML Files with Stambia, the default behavior for null values is to not include the element/attribute in the file.
But we might need to include null or empty values in the file and there are several solutions to do it.
The difference between empty and null values is:
- Empty value will return "" (an empty string for example if the element is a string)
- Null value will return the real null value
Including empty values
Empty values can be set in the mapping expression with two single quotes.
As oracle consider empty values as null (cf : https://docs.oracle.com/cd/B28359_01/server.111/b28286/sql_elements005.htm) this solution will not work on oracle databases.
Including null values
To include the real 'null' value into an element :
nullin the mapping expression
- Set the
Nil Behaviorparameter of the template to
This will only work for elements, not attributes.
xsi:nil represents the null value in XML.
For further information about nil behavior you can look at :