How to force an empty element to the xml output when source data contain no values for the given mapped filed?
Setting default value as " " for that output element/ is there any other process also?
Yes, you can do in this way as well.
After the map, you can keep Data process --> Search/Replace as below to remove blank space:
Search: > < (note that space between > and <)
Hi ragitha ravella
In the XML profile, set Min Occurs=1 for that element and enable Respect Min Occurs in the options tab
Try this and let me know if it works.
This will work. this is the simplest option to retain the element when source field returns empty value. Remember not even space, just the empty element. below is a sample
Set your source element min occurs ==1
And check Respect min occurs on Options tab
This is a nice solution fro XML validity but it doesn't seem to maintain any attributes that the element had.E.g.<ws:Company ws:PriorValue="OldCompanyName"/>
becomes<ws:Company/>Is there a way of doing this where it will maintain the attributes?
Hi Odhran Hardy
That's good observation.
Did you try checking the Required check box in the profile for the attribute configuration?
If you check this, the attribute should populate even for empty element, like this: <child2 attr1="attValue" />
How do I add empty tag <ws:Company></ws:Company> instead of just <ws:Company/>
As mentioned previously in this post:
Setting default value as " " for that output element.
Retrieving data ...