Flat file schema and delimiter issues

Home Page Forums BizTalk 2004 – BizTalk 2010 Flat file schema and delimiter issues

Viewing 2 reply threads
  • Author
    Posts
    • #19649

      I have a schema based on a flat file that looks like this:

      Start¤2008-10-12¤
      1¤2008-10-12¤299¤2008-01-12¤2008-10-01¤Testdata¤TheSupplier¤2008-11-30¤
      1¤2008-10-12¤299¤2008-01-12¤2008-10-01¤Testdata¤TheSupplier¤2008-11-30¤
      1¤2008-10-12¤299¤2008-01-12¤2008-10-01¤Testdata¤TheSupplier¤2008-11-30¤
      1¤2008-10-12¤299¤2008-01-12¤2008-10-01¤Testdata¤TheSupplier¤2008-11-30¤
      1¤2008-10-12¤299¤2008-01-12¤2008-10-01¤Testdata¤TheSupplier¤2008-11-30¤
      1¤2008-10-12¤299¤2008-01-12¤2008-10-01¤Testdata¤TheSupplier¤2008-11-30¤
      End¤6¤

      Each row is ended by a CR, even the last one.

      I have specified the following xsd:

      <Schema>
           Root
                Header
                     Start
                     StartDate
                Main
                     Field1
                     Field2
                     Field3
                     Field4
                     Field5
                     Field6
                     Field7
                     Field8
                Footer
                     End
                     NoOfRecords

      The Header and Footer max/min occurencies are set to 1 since they just occur once in each file.

      The Main max/min occurencies  are set to Unbound/0 since tha main section can occur none or uncountable times in a file.

      I have set the child delimiter=¤, child delimiter type=character and child order=postfix on header, main and footer.

      I have set the child delimiter=0x0D, child delimiter type=hexadecimal and child order=postfix on root indicating that each record (header, main, footer) or line in the file really, is ended by a cr. The min/max occurrencies is not set for the root.

      When I validate the schema I get the following error:

       Invoking component…
      C:\SWECOBT Test\Files\input.txt: error BEC2004: Unexpected end of stream while looking for:
      ‘¤’
      The current definition being parsed is Main. The stream offset where the error occured is 1040. The line number where the error occured is 8. The column where the error occured is 15.
      C:\SWECOBT Test\SwecoBTTest\SwecoBTTest\FlatFileSchemaTest.xsd: error BEC2004: Validate Instance failed for schema FlatFileSchemaTest.xsd, file: <
      file:///C:\SWECOBT Test\Files\input.txt>.
      Component invocation succeeded.

      What does this mean, what have I done wrong?

      Regards

    • #19651

       The FF Dasm needs to be able to identify the different record types. It know about the start record, there is only one and then it works on the data records. But it does not know when the Data records end (unbounded) and the End record starts.

      You need to use Tag Identifiers on Header and Footer

      <Schema>
           Root
                Header – tag = “Start¤”
                     StartDate
                Main
                     Field1
                     Field2
                     Field3
                     Field4
                     Field5
                     Field6
                     Field7
                     Field8
                Footer tag = “End¤”
                     NoOfRecords

      You need to include the delimiter in the tag to maintain the Postfix child order.

      Note the Start and End nodes have been removed from the header and footer records

    • #19665

      Try setting the Child Delimiter = 0x0D 0x0A

      0x0D is just the carriage return (CR) you need the line feed (LF) 0x0A as well. I have numerous Flat File schemas defined this way.

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