I could figure out that issue is happening because of the way repeating elements are created. We did use a transformer to hardcode the XML namespace as a text and later convert it in XML stage by specifying the DATA ELEMENT as "XML". The example is mentioned below: -
we had to provide an XML message on MQ where one particular Address section should look like following: -
Code: Select all
<ns5:Address>
<ns4:Line>1500 SCENIC DR</ns4:Line>
<ns4:Line>CROSSROADS & AVE</ns4:Line>
<ns4:Line>NEAR OLD CHURCH</ns4:Line>
<ns4:Line />
</ns5:Address>
Code: Select all
'<ns4:Line>':Addre Line 1:'</ns4:Line>':'<ns4:Line>':Addre Line 2:'</ns4:Line>':'<ns4:Line>':Addre Line 3:'</ns4:Line>':'<ns4:Line>':Addre Line 4:'</ns4:Line>'.
This can be resolved by sending all address lines as it is from one XML stage and then, just before second XML stage the transformer should be used with Field function to extract handled value between the tags (<addrline1>........)and constructing the repeating element again.
But this is only possible if number of repeating elements are less, we have a job where there are 32 different repeating elements. I wanted to know if there is any robust method using XML stage of something in DataStage to handle all such scenarios.