Note: It generates the minimal XML and parent tag. The parent tags are shown as Unary Tag in the browser.
Case 2: Creation of Zero Byte XML file.
Even though setting all the above property you will get an empty XML file with no data or only with parent tags. If downstream system Like MFT (Managed File Transfer) consumes this garbage file, you will end up with errors while processing. To avoid these kinds of errors we have to set two custom properties in the Integration Service:
WriteNullXMLFile = No
The WriteNullXMLFile custom property skips creating an XML file when the XML Generator transformation or Target doesn’t receive data. The Default value for this parameter is Yes and. if you set No , the minimal XML document will not be generated and the target XML file size will be of zero byte.
2) Suppress the Empty Parent Tag
A PowerCenter session with an XML target writes empty parent tags to the XML file when all child elements are null. This may occur even when the Null Content Representation option is set to No Tag in the session properties.
SuppressNilContentMethod = ByTree
The SuppressNilContentMethod server parameter will suppress the parent tags as well as the child tags when all the child elements are null. To achieve this, set the custom property to “ByTree”.
The ByTree flag suppresses non-leaf elements up to (but not including) the document root, when the entire element chain originating at the specified element contains no data. ByTree flag is always optimal.
For example the Street1 and Street2 values are empty, without setting the property you will get the below output with Street Unary tag:
If you set the Property SuppressNilContentMethod = ByTree the entire Street tag will be vanished.
3) To reduce the Session log size while using XML as Target
By default; it is Yes, the Informatica Server writes duplicate row warnings and duplicate rows for
XML targets to the session log.
4 )To reduce the cache file size created by XML target and increase the performance of reading large XML files.
How to set the Custom Properties?
Infa 8.x and Above
1. Connect to the Administration Console
2. Stop the Integration Service
3. Select the Integration Service
4. Under the Properties tab, click Edit in the Custom Properties section
5. Under Name enter WriteNullXMLFile = No
6. Under Value enter No
7.Under Name enter SuppressNilContentMethod
8. Under Value enter ByTree
9. Click OK
10. Restart the Integration Service
Starting with PowerCenter 8.5, this change could be done at the session task itself as follows:
These custom properties would override the DI service level properties.
1. Edit the session
2. Select Config Object tab
3. Under Custom Properties add the attribute WriteNullXMLFile=No and SuppressNilContentMethod=ByTree