Skip to Content
avatar image
Former Member

Content Conversion Dropping Last Field

I have a comma delimited file that I am converting to XML via a sender adapter's file content conversion. The data looks similar to this:

Field1,,Field3,Field4
Field1,Field2,Field3,
Field1,Field2,,

I am expecting the XML to be:

<Recordset>
  <Record>
    <FirstField>Field1</FirstField>
    < /SecondField>
    <ThirdField>Field3</ThirdField>
    <FourthField>Field4</FourthField>
  </Record>
    <FirstField>Field1</FirstField>
    <SecondField>Field2</SecondField>
    <ThirdField>Field3</ThirdField>
    < /FourthField>
  <Record>
  </Record>
  <Record>
    <FirstField>Field1</FirstField>
    <SecondField>Field2</SecondField>
    < /ThirdField>
    < /FourthField>
  </Record>
<Recordset>

This is what I am getting:

<Recordset>
  <Record>
    <FirstField>Field1</FirstField>
    < /SecondField>
    <ThirdField>Field3</ThirdField>
    <FourthField>Field4</FourthField>
  </Record>
    <FirstField>Field1</FirstField>
    <SecondField>Field2</SecondField>
    <ThirdField>Field3</ThirdField>
  <Record>
  </Record>
  <Record>
    <FirstField>Field1</FirstField>
    <SecondField>Field2</SecondField>
    < /ThirdField>
  </Record>
<Recordset>

If the last field of my comma delimited file is empty, no XML tag is created. How can I force the final XML tag to be created? Your assistance is appreciated.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    May 31, 2006 at 06:10 AM

    Hi Craig,

    The XML tag for the last field is not getting created only because there is no comma which clearly specifies that the field does not have a value.

    If the data is sent in the following way:-

    Field1,,Field3,Field4

    Field1,Field2,Field3,,

    Field1,Field2,,,

    Then I think, you will be able to get the desired xml format by using the appropriate parameters for record set structures.

    Hope this helped-or did you already know this!:)

    Regards,

    Sushumna

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      In your data the last field is not comming and since you must have put last field optional it's not giving you an error at the adapter level and not creating the tag.

      Either you have to make lastfieldoptional 'no' or you have to use Creatif function to create tag even if there in no value coming in incoming data.

      Regards

      Vijaya

  • avatar image
    Former Member
    May 31, 2006 at 06:53 AM

    Hi Craig,

    Try using this parameter in content conversion and check if it works

    <b>keepIncompleteFields</b> - <b>true</b>

    Cheers,

    Dhana

    Add comment
    10|10000 characters needed characters exceeded