Generation of empty node in our XML is a common problem. We can halt the generation of empty nodes in BizTalk Mapper by the use of Logical Existence functiod.
Suppose we have to map the Customer's details. We have two records i.e. Customer (which contains header details) and Customer_Details (which contains details) in source schema. In destination schema we have three records i.e. Customer_Header, Customer_Details and ShippingAddress.
Now suppose that the source schema record Customer_Details is not mandatory so can be present or not, and it is mapped to Customer_Details and Address records of Destination Schema.
Now when the source schema record Customer_Details is not present then it creates the empty records.
Source Schema :
Destination Schema :
Input XML file without Customer_Details record :
Map without Logical existence :
Output after Test Map using above XML file :
In the above result Cusomer_Details and ShippingAddress are generating empty.Mapping the Logical Existence functiod to these records that are generating empty solves our problem.
Map after using logical existence functiod :
Result After Test Map and using Logical Existence :
What Logical Existence does ?
The logical functiod is used to determine whether the Record, Field Element, or Field Attribute node that is linked to it exists in a particular input instance message. If functiod evaluates to true then destination schema node is generated otherwise not.