cancel
Showing results for 
Search instead for 
Did you mean: 

XML field empty mapping takes next value

Former Member
0 Kudos

Hi,

I have the following XML input.

- <f:Property x:type="f:SingletonInteger32" propertyId="LIMPrint" settable="1">

<f:Value>0</f:Value>

</f:Property>

<f:Property x:type="f:SingletonString" propertyId="DocumentFormSubType" settable="1" />

- <f:Property x:type="f:SingletonString" propertyId="DocumentFormType" settable="1">

<f:Value>Legal</f:Value>

</f:Property>

When mapping this to another structure it works ok but when the mapping reaches an empty Property (meaning: no Value) see above: propertyId="DocumentFormSubType"

then it takes the first available 'Value', meaning DocumentFormSubType maps to a value of 'Legal".

The 'DocumentFormType" takes also the next available value causing a mix up of all the property/value pairs after the empty value of DocumentFormSubType

Any ideas how to fix this ? I've tried all possible variantions with changing the context..

thanks,

eric

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Eric,

You use MapWithDefault funtion. This will ensure when the source has no incoming values, default values are correctly assigned. You need to use this function before mapping each node.

Thanks

Sudharshan

Former Member
0 Kudos

Hi,

MapwithDefault will not work because it will find a value - the wrong one, but still...

I got it fixed by adding another map that runs first. This will set the Property field with no value to NULL.

Then I run this output through the initial map and use a RemoveContext to get the correct values.

Cheers,

Eric

VijayKonam
Active Contributor
0 Kudos

I believe this type of mapping can be achieved by inserting a "SUPPRESS" if the node value is found to be null.

VJ

former_member194786
Active Contributor
0 Kudos

Hi Eric,

Can you provide the target structure that you are getting(as error) and also the target structure you require. It will help understand your requirment more clearly.

Regards,

Sanjeev.

Former Member
0 Kudos

Hi,

Are you using any node functions like remove contexts or splitby value?

Former Member
0 Kudos

I've tried all possible variantions with changing the context.. as I said in my posting.