locked
How to add a new line character (\r\n) after each child element in flat file RRS feed

  • Question

  • Hello All,

    I am new to Biztalk. I have a scenario where i am converting my xml in to Flat file. I have added Map, Flat file assembler to convert XML to Flat file.

    In my output i am getting all my records(child elements) in a single line. Flat file is positional and i expect each record on new line.

    I tried with Child Delimiter property setting hexadecimal value 0XD 0XC but nothing helped. 

    Below is how i expect my flat file to be:

    ChildRecord1  field1 field2 field3

    ChildRecord2  field1 field2 

    ChildRecord3  field1 field2 field3 field3

    But my output is like below:

    ChildRecord1  field1 field2 field3 ChildRecord2  field1 field2 ChildRecord3  field1 field2 field3 field3

    Please Help. Thanks in advance

    Wednesday, January 20, 2016 1:32 PM

Answers

  • Hi,

    It should work !! Can you show a glimpse of your schema ? Check the below image whcih shows how to implement 0x0D 0x0A, picture also shows the result when generate instance used to generate the schema sample.

    As you can see it 0x0D 0x0A is applied on the root node which would contain your ChildRecord1,ChildRecord2 and ChildRecord3.

    Please indicate "Mark as Answer" or "Mark as Helpful" if this post has answered the question

    Regards

    Rahul Madaan

    biztalkvillage.blogspot.com


    • Edited by Rahul_Madaan Wednesday, January 20, 2016 2:54 PM
    • Marked as answer by Imenrique Thursday, January 21, 2016 7:26 AM
    Wednesday, January 20, 2016 2:50 PM
  • Hey I got a solution.

    I was setting child delimiter setting at schema node. which was not working

    Also, At root node there is one property called "structure" i had set to a "positional". When you have this as positional child delimiter property is hidden at Root node. It is only seen when u change structure property to "delimited".

    I changed it to "delimited" and added child delimiter at Root node. It worked like charm.

    Thanks for your time and replies. :)

    • Marked as answer by Imenrique Thursday, January 21, 2016 7:26 AM
    Thursday, January 21, 2016 7:25 AM

All replies

  • Use

    0x0D 0x0A

    Morten la Cour

    Wednesday, January 20, 2016 1:43 PM
  • Thanks for the reply. I Tried with 0x0D 0x0A, Child delimiter type - Hexadecimal, PostFix.

    But still not working. :(

    Wednesday, January 20, 2016 1:50 PM
  • Hi,

    It should work !! Can you show a glimpse of your schema ? Check the below image whcih shows how to implement 0x0D 0x0A, picture also shows the result when generate instance used to generate the schema sample.

    As you can see it 0x0D 0x0A is applied on the root node which would contain your ChildRecord1,ChildRecord2 and ChildRecord3.

    Please indicate "Mark as Answer" or "Mark as Helpful" if this post has answered the question

    Regards

    Rahul Madaan

    biztalkvillage.blogspot.com


    • Edited by Rahul_Madaan Wednesday, January 20, 2016 2:54 PM
    • Marked as answer by Imenrique Thursday, January 21, 2016 7:26 AM
    Wednesday, January 20, 2016 2:50 PM
  • rahul_Madaan 

    I tried the way you have described. But its still not working. 

    My Generated instance looks like below. It is inline.

    2BEST-LOAD-NUMBER_x00BEST-PRO-NUMBER_x002BESTBEST-TCONNECT-SHIPPER     _x3BEST-LOAD-NUMBER_x00BEST-CARRIER_x0020_ BEST-TYPE-OF-EQUIPMENT_x0BEST-RATBEST-PERBEST-EXTRA-DATA_x002BEST-BEST-PRO-NUMBER_x002BESCONNECT-CARRIER-SERVICE-SYMBOL                                        CONNECT-CARRIER-SERVICE-NAME                      CONNECONRo4ERROR               CONNECT-ERROR                                         _x5BEST-LOAD-NUMBER_x00BEST-CARRIER_x0020_ BEST-PICBESTBEST-TRAILBEST-TRUCKBEST-CARRIER-COMMENT                              BEST-LOADING-LOCATION_x0020_                      BESTBEST-EXTRA-DATA_x002BCONNECONNECOCONNECT-TRACKINGNO       CONNECT-BARCODE          _x

    Where i am expecting like below:

    2BEST-LOAD-NUMBER_x00BEST-PRO-NUMBER_x002BESTBEST-TCONNECT-SHIPPER     _x
    3BEST-LOAD-NUMBER_x00BEST-CARRIER_x0020_ BEST-TYPE-OF-EQUIPMENT_x0BEST-RATBEST-PERBEST-EXTRA-DATA_x002BEST-BEST-PRO-NUMBER_x002BESCONNECT-CARRIER-SERVICE-SYMBOL                                        CONNECT-CARRIER-SERVICE-NAME                      CONNECONRo
    4ERROR               CONNECT-ERROR                                                                                                                                                     
    5BEST-LOAD-NUMBER_x00BEST-CARRIER_x0020_ BEST-PICBESTBEST-TRAILBEST-TRUCKBEST-CARRIER-COMMENT                              BEST-LOADING-LOCATION_x0020_                      BESTBEST-EXTRA-DATA_x002BCONNECONNECOCONNECT-TRACKINGNO       CONNECT-BARCODE          _x


    Thursday, January 21, 2016 6:38 AM
  • I am not able to add my schema. You cannot add images, links until we validate your account.. 

    Below is setting of my schema. Please help

    <?xml version="1.0" encoding="utf-16" ?>
    - <xs:schema xmlns="http://ParcelDemo.BestTResponseSchema"xmlns:b="http://schemas.microsoft.com/BizTalk/2003"targetNamespace="http://ParcelDemo.BestTResponseSchema"xmlns:xs="http://www.w3.org/2001/XMLSchema">
    - <xs:annotation>
    - <xs:appinfo>
      <schemaEditorExtension:schemaInfo namespaceAlias="b"extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension" standardName="Flat File"xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions"/>
      <b:schemaInfo standard="Flat File" codepage="65001" pad_char_type="none"count_positions_by_byte="false" parser_optimization="speed" suppress_empty_nodes="false"generate_empty_nodes="true" allow_early_termination="false" early_terminate_optional_fields="false"allow_message_breakup_of_infix_root="false" compile_parse_tables="false"root_reference="BestTResponse" child_delimiter_type="hex" schema_type="document"lookahead_depth="5" default_child_delimiter="0x0D 0x0A" />

    Thursday, January 21, 2016 6:40 AM
  • Hey I got a solution.

    I was setting child delimiter setting at schema node. which was not working

    Also, At root node there is one property called "structure" i had set to a "positional". When you have this as positional child delimiter property is hidden at Root node. It is only seen when u change structure property to "delimited".

    I changed it to "delimited" and added child delimiter at Root node. It worked like charm.

    Thanks for your time and replies. :)

    • Marked as answer by Imenrique Thursday, January 21, 2016 7:26 AM
    Thursday, January 21, 2016 7:25 AM