Question
· 20 hr ago

How to set XMLIGNORENULL for non %String property?

By extending %XML.Adaptor, we can use

Parameter XMLIGNORENULL   

to handle empty tags in output xml file from %Persistent. But this parameter only applies to %String property. What if a class has other types of properties, like %Stream (for holding large chunk of data). What is the recommended handle if we cannot use XMLIGNORENULL here?

Context: In change control, exported .xml file is important to make diff between versions. To correctly handle edits on a previously null property (for example, the first edit to store value in "Data" field), we need XMLIGNORENULL to be "inputonly" so that our stream data can be check out and revert in change control management.

Product version: IRIS 2024.1
Discussion (1)2
Log in or sign up to continue

It sounds like what you want is to use XMLNIL. This will export null object Properties as  xsi:nil="true". Then on import the default behavior is to set such a valued Property to be a new instance of that object with no Properties set. See Handling Empty Strings and Null Values | Projecting Objects to XML | InterSystems IRIS Data Platform 2024.3
for more information.