Problems Mapping from XML Schema to Positional Flat File Schema

Home Page Forums BizTalk 2004 – BizTalk 2010 Problems Mapping from XML Schema to Positional Flat File Schema

Viewing 1 reply thread
  • Author
    Posts
    • #21229

      Hello all, I’ve been hunting around and have come up short on solving a problem mapping repeating records in an XML schema to a positional flat file schema.
      The flat file schema can accomodate a limited number of these records, but must maintain the same number of characters per line The mapped records have to appear in sequence.

      I’ve tried using the Value Mapping (Flattening) functoid as described here: http://msdn.microsoft.com/en-us/library/ms942902.aspx
      but the method uses the code values to populate the values at specific nodes (e.g. a record with code A will map to Record1 in the Flat File schema, Code B will map to Record 2, etc.

      I need to be able to have the repeating records map to the flat file records in sequence, without respect to the data they contain. The order of the repeating records doesn’t matter, but the flat Record1 must be populated before Record2, which is populated before Record3, and so on. Any unpopulated flat records will remain as whitespace.

      Any suggestions are welcome.
      Thanks,
      Jason L.

      Here are simple examples I’m using to test out the mapping before moving to the more complicated business case:

      Schema1:

      FlatFileSchema1:

    • #21231

      Schema1:

      xs:element name=”Root”
      xs:complexType
      xs:sequence
      xs:element minOccurs=”1″ maxOccurs=”5″ name=”Record1″
      xs:complexType
      xs:sequence
      xs:element name=”Field1″ type=”xs:string” /

      xs:element name=”Code” type=”xs:string” /

      /xs:sequence
      /xs:complexType
      /xs:element
      /xs:sequence
      /xs:complexType
      /xs:element

      FlatFile Schema1:

      xs:element name=”Root”
      xs:annotation
      xs:appinfo
      b:recordInfo structure=”positional” preserve_delimiter_for_empty_data=”true” suppress_trailing_delimiters=”false” sequence_number=”1″ /

      /xs:appinfo
      /xs:annotation
      xs:complexType
      xs:choice minOccurs=”0″
      xs:annotation
      xs:appinfo
      b:groupInfo sequence_number=”0″ /

      /xs:appinfo
      /xs:annotation
      xs:element minOccurs=”1″ maxOccurs=”1″ name=”Record1″
      xs:annotation
      xs:appinfo
      b:recordInfo sequence_number=”1″ structure=”positional” preserve_delimiter_for_empty_data=”true” suppress_trailing_delimiters=”false” /

      /xs:appinfo
      /xs:annotation
      xs:complexType
      xs:sequence
      xs:annotation
      xs:appinfo
      b:groupInfo sequence_number=”0″ /

      /xs:appinfo
      /xs:annotation
      xs:element name=”Field1″ type=”xs:string”
      xs:annotation
      xs:appinfo
      b:fieldInfo sequence_number=”1″ justification=”left” pos_length=”10″ /

      /xs:appinfo
      /xs:annotation
      /xs:element
      xs:element name=”Code” type=”xs:string”
      xs:annotation
      xs:appinfo
      b:fieldInfo sequence_number=”2″ justification=”left” pos_length=”10″ /

      /xs:appinfo
      /xs:annotation
      /xs:element
      xs:annotation
      xs:appinfo
      b:fieldInfo sequence_number=”3″ justification=”left” pos_length=”10″ /

      /xs:appinfo
      /xs:annotation
      /xs:element
      /xs:sequence
      /xs:complexType
      /xs:element
      xs:element minOccurs=”1″ maxOccurs=”1″ name=”Record2″
      xs:annotation
      xs:appinfo
      b:recordInfo sequence_number=”2″ structure=”positional” preserve_delimiter_for_empty_data=”true” suppress_trailing_delimiters=”false” /

      /xs:appinfo
      /xs:annotation
      xs:complexType
      xs:sequence
      xs:annotation
      xs:appinfo
      b:groupInfo sequence_number=”0″ /

      /xs:appinfo
      /xs:annotation
      xs:element name=”Field1″ type=”xs:string”
      xs:annotation
      xs:appinfo
      b:fieldInfo justification=”left” pos_length=”10″ sequence_number=”1″ /

      /xs:appinfo
      /xs:annotation
      /xs:element
      xs:element name=”Code” type=”xs:string”
      xs:annotation
      xs:appinfo
      b:fieldInfo justification=”left” pos_length=”10″ sequence_number=”2″ /

      /xs:appinfo
      /xs:annotation
      /xs:element
      xs:annotation
      xs:appinfo
      b:fieldInfo justification=”left” pos_length=”10″ sequence_number=”3″ /

      /xs:appinfo
      /xs:annotation
      /xs:element
      /xs:sequence
      /xs:complexType
      /xs:element
      xs:element minOccurs=”1″ maxOccurs=”1″ name=”Record3″
      xs:annotation
      xs:appinfo
      b:recordInfo sequence_number=”3″ structure=”positional” preserve_delimiter_for_empty_data=”true” suppress_trailing_delimiters=”false” /

      /xs:appinfo
      /xs:annotation
      xs:complexType
      xs:sequence
      xs:annotation
      xs:appinfo
      b:groupInfo sequence_number=”0″ /

      /xs:appinfo
      /xs:annotation
      xs:element name=”Field1″ type=”xs:string”
      xs:annotation
      xs:appinfo
      b:fieldInfo justification=”left” pos_length=”10″ sequence_number=”1″ /

      /xs:appinfo
      /xs:annotation
      /xs:element
      xs:element name=”Code” type=”xs:string”
      xs:annotation
      xs:appinfo
      b:fieldInfo justification=”left” pos_length=”10″ sequence_number=”2″ /

      /xs:appinfo
      /xs:annotation
      /xs:element
      xs:annotation
      xs:appinfo
      b:fieldInfo justification=”left” pos_length=”10″ sequence_number=”3″ /

      /xs:appinfo
      /xs:annotation
      /xs:element
      /xs:sequence
      /xs:complexType
      /xs:element
      xs:element minOccurs=”1″ maxOccurs=”1″ name=”Record4″
      xs:annotation
      xs:appinfo
      b:recordInfo sequence_number=”4″ structure=”positional” preserve_delimiter_for_empty_data=”true” suppress_trailing_delimiters=”false” /

      /xs:appinfo
      /xs:annotation
      xs:complexType
      xs:sequence
      xs:annotation
      xs:appinfo
      b:groupInfo sequence_number=”0″ /

      /xs:appinfo
      /xs:annotation
      xs:element name=”Field1″ type=”xs:string”
      xs:annotation
      xs:appinfo
      b:fieldInfo justification=”left” pos_length=”10″ sequence_number=”1″ /

      /xs:appinfo
      /xs:annotation
      /xs:element
      xs:element name=”Code” type=”xs:string”
      xs:annotation
      xs:appinfo
      b:fieldInfo justification=”left” pos_length=”10″ sequence_number=”2″ /

      /xs:appinfo
      /xs:annotation
      /xs:element
      xs:annotation
      xs:appinfo
      b:fieldInfo justification=”left” pos_length=”10″ sequence_number=”3″ /

      /xs:appinfo
      /xs:annotation
      /xs:element
      /xs:sequence
      /xs:complexType
      /xs:element
      xs:element minOccurs=”1″ maxOccurs=”1″ name=”Record5″
      xs:annotation
      xs:appinfo
      b:recordInfo sequence_number=”5″ structure=”positional” preserve_delimiter_for_empty_data=”true” suppress_trailing_delimiters=”false” /

      /xs:appinfo
      /xs:annotation
      xs:complexType
      xs:sequence
      xs:annotation
      xs:appinfo
      b:groupInfo sequence_number=”0″ /

      /xs:appinfo
      /xs:annotation
      xs:element name=”Field1″ type=”xs:string”
      xs:annotation
      xs:appinfo
      b:fieldInfo justification=”left” pos_length=”10″ sequence_number=”1″ /

      /xs:appinfo
      /xs:annotation
      /xs:element
      xs:element name=”Code” type=”xs:string”
      xs:annotation
      xs:appinfo
      b:fieldInfo justification=”left” pos_length=”10″ sequence_number=”2″ /

      /xs:appinfo
      /xs:annotation
      /xs:element
      xs:annotation
      xs:appinfo
      b:fieldInfo justification=”left” pos_length=”10″ sequence_number=”3″ /

      /xs:appinfo
      /xs:annotation
      /xs:element
      /xs:sequence
      /xs:complexType
      /xs:element
      /xs:choice
      /xs:complexType
      /xs:element

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