Expectation when create new object, default value assign if set NULL.
But immcfg -f <xml file> does not work as expect if contain empty tag
Reproduce steps:
* Load xml file: immcfg -f <xml file below>
* Expected value after loaded is default value (15)
<?xml version="1.0"?>
<imm:IMM-contents xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SAI-AIS-IMM-XSD-A.02.13.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:imm="http://www.saforum.org/IMMSchema">
<class name="Test">
<category>SA_CONFIG</category>
<rdn>
<name>test</name>
<type>SA_STRING_T</type>
<category>SA_CONFIG</category>
<flag>SA_INITIALIZED</flag>
</rdn>
<attr>
<name>limitTime</name>
<type>SA_UINT32_T</type>
<category>SA_CONFIG</category>
<flag>SA_WRITABLE</flag>
<default-value>15</default-value>
</attr>
</class>
<object class="Test">
<dn>test=1</dn>
<attr>
<name>limitTime</name>
<value xsi:nil="true"/>
</attr>
</object>
</imm:IMM-contents>
Hi Thien,
I change a little of xml file to
And it shows that
Please check whether it is expected behavior.
Hi Thang,
The input from xml "<value xsi:nil="true">" is valid. The output of immlist test=1 is expected.
limitTime SA_UINT32_T 15 (0xf)</value>
The input from xml "<value></value>" is valid. But the output of immlist test=2 is not expected.
limitTime SA_UINT32_T 0 (0x0)
Last edit: Thien Minh Huynh 2025-12-01
Hi Thang,
https://sourceforge.net/p/opensaf/mailman/message/59267063/
I have updated to handle use case that you mentioned.
Best Regards,
Thien
commit 5c7ff8b80e54cdf0ac1e203d9f0db1ccc6ab9269 (HEAD -> develop, origin/develop, ticket-3392)
Author: Thien Minh Huynh thien.m.huynh@endava.com
Date: Mon Nov 3 09:04:42 2025 +0000
Hi Thang,
Sorry, I want to correct this use case.
This is not considering a valid empty/nil use case. It violates with empty data if data type of string is empty. That what xsi:nil="true" introduced.
Example:
This is empty data. not consider null.
Best Regards,
Thien
Last edit: Thien Minh Huynh 2025-12-18
commit 074cdef2349a019edadfba965961001975481bfb (HEAD -> develop, origin/develop, ticket-3392)
Author: Thien Minh Huynh thien.m.huynh@endava.com
Date: Thu Dec 18 02:45:17 2025 +0000