Trim
This example shows XML to flat file transformation in which the white space surrounding the data in XML is removed. Trimming is not applicable in the flat file to XML transformation.
Flat File Definition:
<BankRepository>
<Files>
<File>
<ID>SampleNine</ID>
<Messages>
<Message>
<IgnorePrecedingFieldSeparator>0</IgnorePrecedingFieldSeparator>
<DefaultEmptyFieldValue>
<Numeric></Numeric>
<Alpha></Alpha>
</DefaultEmptyFieldValue>
<DefaultAlignment>
<Numeric>RIGHT</Numeric>
<Alpha>LEFT</Alpha>
</DefaultAlignment>
<DefaultPadding>
<Numeric>0</Numeric>
<Alpha> </Alpha>
</DefaultPadding>
<DefaultTrim>
<Numeric>1</Numeric>
<Alpha>1</Alpha>
</DefaultTrim>
<Name>TopNode</Name>
<TagName>TopNode</TagName>
<EscapeChar/>
<RecordSeparator>\n</RecordSeparator>
<FieldSeparator>:</FieldSeparator>
<Records>
<Record>
<Name>Record</Name>
<TagName>Record</TagName>
<MinOccur>1</MinOccur>
<MaxOccur>0</MaxOccur>
<Fields>
<Field>
<Name>FieldOne</Name>
<TagName>FieldOne</TagName>
<DataType>Alpha</DataType>
<PaddingChar/>
<DecimalLength/>
<Alignment>LEFT</Alignment>
<StartPos>0</StartPos>
<Length>0</Length>
<DefaultValue></DefaultValue>
<Identifier>0</Identifier>
</Field>
<Field>
<Name>FieldTwo</Name>
<TagName>FieldTwo</TagName>
<DataType>Alpha</DataType>
<PaddingChar/>
<DecimalLength/>
<Alignment>LEFT</Alignment>
<StartPos>0</StartPos>
<Length>0</Length>
<DefaultValue></DefaultValue>
<Identifier>0</Identifier>
</Field>
</Fields>
</Record>
</Records>
</Message>
</Messages>
</File>
</Files>
</BankRepository>
Input File:
<TopNode>
<Record>
<FieldOne> a </FieldOne>
<FieldTwo> b </FieldTwo>
</Record>
<Record>
<FieldOne> e</FieldOne>
<FieldTwo>f </FieldTwo>
</Record>
</TopNode>
The expected result will be:
a:b:
e:f: