Flat File To XML Maps , V Frustrating , Help !!!!

Home Page Forums BizTalk 2004 – BizTalk 2010 Flat File To XML Maps , V Frustrating , Help !!!!

Viewing 3 reply threads
  • Author
    Posts
    • #17944

      I would of thought this was a simple scenario but I just can't get the map to validate or test successfully.

      I have an input tab (i.e >)  seperated file with a header record i.e

      field1>field2>field3
      aaa>bbb>ccc
      ddd>eee>fff
      ggg>hhh>iii

      There could be any nunber of records in the input file.

      Output file is an existing biztalk map with the following records and elements

      <?xml version="1.0" encoding="utf-16" ?>

      <xs:element name="Navision_ProdStock_XML">
      <xs:complexType>
      <xs:sequence>
      <xs:element name="Item">
      <xs:complexType>
      <xs:sequence>
        <xs:element name="productid" type="xs:string" />
        <xs:element name="stockonhand" type="xs:string" />
        </xs:sequence>
        </xs:complexType>
        </xs:element>
      <xs:element name="Any">
      <xs:complexType>
      <xs:sequence>
        <xs:any />
        </xs:sequence>
        </xs:complexType>
        </xs:element>
        </xs:sequence>
        </xs:complexType>
        </xs:element>
        </xs:schema>
      The other issue is that what ever I do in specifying the input file for testing the map, it always uses the one biztalk creates.
      Happy to provide more information, any help would be appreciated as I am really stuck 🙁
      Thanks
    • #17951

      Not enough information provided, nobody can help you. Sorry.

    • #17960

      "The other issue is that what ever I do in specifying the input file for testing the map, it always uses the one biztalk creates."

      You need to right-click the schema in Solution Explorer, select Properties and set the Input Instance Filename to the name of you test file. Also check that the Validate Input Instance Type is set to native and that the Generate Instance Output Type is set to Xml to see the Xml representation.

      Nick

      Nick Heppleston | http://www.modhul.com&nbsp;

      • #17963

        Minor correction.

        I dint understood frm where Validate Input Instance Type,Generate Instance Output type came in Map.

        I suppose ur talking about.

        Test Map input=Native

        Test Map Output=XML

        Test Map Input Instance=Your text file path[input file path].

        • #17966

          These settings are on the schema – I have not provided details on how to resolve the mapping issue (my schema post is apparently under moderation!)

           

          Nick. 

          • #18010

            Well Rastead.

            Well your Schema and generated output  dint matched when I copied your Schema.

            How are the child elements Tab delimited.

            I tried using positional things work fine…

            I feel you can go ahead with positional if the Users are fine with it.

    • #17964

      I've kind of work out part of this issue now although Im not sure if I'm going about it the right way !!

      I created a pipelline with a flat file schema, I can now get the send and receive ports to convert the flat file into an xml document, only issue I have now is that the flat file consists of multiple records but I always end up with. Once I have XML the rest should be ease (I Hope 🙂 )

       a) Only One Record
      b) All the data from the end of the first record to the end of the file in the last field of the XML created.

       Input file is (Tab seperated Fields)

      product_id stock_on_hand committed being_receipted in_transit on_order first_available_stock manufactured bundled last_updated
      ACE0307 0 0 0 0 0 10 Days   07-12-2006 00:08:17
      ACE0486 0 0 0 0 0 10 Days   07-12-2006 00:08:17
      ACE0488 0 0 0 0 0 10 Days   07-12-2006 00:08:17
      ACE9223 0 0 0 0 0 10 Days   07-12-2006 00:08:17
      ACE9237 0 0 0 0 0 10 Days   07-12-2006 00:08:17

      This is what I end up with

      <?xml version="1.0" encoding="utf-8" ?>

      <Record xmlns="">
        <f1>product_id</f1>
        <f2>stock_on_hand</f2>
        <f3>committed</f3>
        <f4>being_receipted</f4>
        <f5>in_transit</f5>
        <f6>on_order</f6>
        <f7>first_available_stock</f7>
        <f8>manufactured</f8>
        <f9>bundled</f9>
        <f10>last_updated ACE0307 0 0 0 0 0 10 Days 07-12-2006 00:08:17 ACE0486 0 0 0 0 0 10 Days 07-12-2006 00:08:17 ACE0488 0 0 0 0 0 10 Days 07-12-2006 00:08:17 ACE9223 0 0 0 0 0 10 Days 07-12-2006 00:08:17 ACE9237 0 0 0 0 0 10 Days 07-12-2006 00:08:17</f10>
        </Record>
        </Root>
      Schema is as follows:

        <?xml version="1.0" encoding="utf-16" ?>
      <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" default_pad_char="" pad_char_type="char" count_positions_by_byte="false" parser_optimization="speed" lookahead_depth="3" 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="Root" />
        </xs:appinfo>
        </xs:annotation>
      <xs:element name="Root">
      <xs:annotation>
      <xs:appinfo>
        <b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xD 0xA" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" sequence_number="1" />
        </xs:appinfo>
        </xs:annotation>
      <xs:complexType>
      <xs:sequence>
      <xs:annotation>
      <xs:appinfo>
        <b:groupInfo sequence_number="0" />
        </xs:appinfo>
        </xs:annotation>
      <xs:element name="Record">
      <xs:annotation>
      <xs:appinfo>
        <b:recordInfo sequence_number="1" structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_delimiter_type="hex" child_order="infix" child_delimiter="0x09" repeating_delimiter_type="hex" repeating_delimiter="0x0D 0x0A" />
        </xs:appinfo>
        </xs:annotation>
      <xs:complexType>
      <xs:attribute name="f1" type="xs:string">
      <xs:annotation>
      <xs:appinfo>
        <b:fieldInfo sequence_number="1" justification="left" />
        </xs:appinfo>
        </xs:annotation>
        </xs:attribute>
      <xs:attribute name="f2" type="xs:string">
      <xs:annotation>
      <xs:appinfo>
        <b:fieldInfo sequence_number="2" justification="left" />
        </xs:appinfo>
        </xs:annotation>
        </xs:attribute>
      <xs:attribute name="f3" type="xs:string">
      <xs:annotation>
      <xs:appinfo>
        <b:fieldInfo sequence_number="3" justification="left" />
        </xs:appinfo>
        </xs:annotation>
        </xs:attribute>
      <xs:attribute name="f4" type="xs:string">
      <xs:annotation>
      <xs:appinfo>
        <b:fieldInfo sequence_number="4" justification="left" />
        </xs:appinfo>
        </xs:annotation>
        </xs:attribute>
      <xs:attribute name="f5" type="xs:string">
      <xs:annotation>
      <xs:appinfo>
        <b:fieldInfo sequence_number="5" justification="left" />
        </xs:appinfo>
        </xs:annotation>
        </xs:attribute>
      <xs:attribute name="f6" type="xs:string">
      <xs:annotation>
      <xs:appinfo>
        <b:fieldInfo sequence_number="6" justification="left" />
        </xs:appinfo>
        </xs:annotation>
        </xs:attribute>
      <xs:attribute name="f7" type="xs:string">
      <xs:annotation>
      <xs:appinfo>
        <b:fieldInfo sequence_number="7" justification="left" />
        </xs:appinfo>
        </xs:annotation>
        </xs:attribute>
      <xs:attribute name="f8" type="xs:string">
      <xs:annotation>
      <xs:appinfo>
        <b:fieldInfo sequence_number="8" justification="left" />
        </xs:appinfo>
        </xs:annotation>
        </xs:attribute>
      <xs:attribute name="f9" type="xs:string">
      <xs:annotation>
      <xs:appinfo>
        <b:fieldInfo sequence_number="9" justification="left" />
        </xs:appinfo>
        </xs:annotation>
        </xs:attribute>
      <xs:attribute name="f10" type="xs:string">
      <xs:annotation>
      <xs:appinfo>
        <b:fieldInfo sequence_number="10" justification="left" />
        </xs:appinfo>
        </xs:annotation>
        </xs:attribute>
        </xs:complexType>
        </xs:element>
        </xs:sequence>
        </xs:complexType>
        </xs:element>
        </xs:schema>
      I'm guessing I have a postfix or infix mixed up somewhere but I have tried changing these values with no result
      Any help would be appreciated as I am totally stuck !!

Viewing 3 reply threads
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.