Sample FlatFileDiss…

Home Page Forums BizTalk 2004 – BizTalk 2010 Sample FlatFileDiss…

Viewing 1 reply thread
  • Author
    Posts
    • #12822

      It is possible to change places elements Header and Body in AllAsOne.xsd? 🙄

    • #12823

      I have that text :

      structure line
      structure line

      structure line
      result structure line

      I have made Xml Schema like to the AllAsOne.xsd of an example FlatFileDiss, but I’ve changed places header and a body.
      And I catch error while processing this FlatFile…
      If I shall establish maxOccurs and minOccurs properties of an element \”Body\” equal to count of \”structure line\” mistakes will not be. But it is wrong, because the count of \”structure line\” is not known.

      • #12824

        ok, thanks for help.
        I use \”Tag Identifier\”.

        But now I have another flat file and I can’t to parse it.
        faltfile:
        [code:1:f1800c3f70]
        01Name LastName 34ShortName R43ShortName R06R!
        27Name LastName 45ShortName R65ShortName R!
        99Name LastName 65ShortName R77ShortName R26ShortName R!
        02Name LastName 25R!
        03Name LastName 03ShortName R27ShortName R!
        @
        [/code:1:f1800c3f70]
        symbol \”!\” – end of line
        \”@\” – end of file
        example schema:
        [code:1:f1800c3f70]
        <xs:element name=\"BaseSchema\">
        <xs:annotation>
        <xs:appinfo>
        <b:recordInfo structure=\"delimited\" preserve_delimiter_for_empty_data=\"true\" suppress_trailing_delimiters=\"true\" sequence_number=\"1\" child_order=\"default\" child_delimiter_type=\"default\" escape_char_type=\"hex\" escape_char=\"0x2A\" />
        </xs:appinfo>
        </xs:annotation>
        <xs:complexType>
        <xs:sequence>
        <xs:annotation>
        <xs:appinfo>
        <b:groupInfo sequence_number=\"0\" />
        </xs:appinfo>
        </xs:annotation>
        <xs:element name=\"Body\">
        <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:sequence>
        <xs:annotation>
        <xs:appinfo>
        <b:groupInfo sequence_number=\"0\" />
        </xs:appinfo>
        </xs:annotation>
        <xs:element minOccurs=\"0\" maxOccurs=\"9\" name=\"RepeatPart\" nillable=\"true\">
        <xs:annotation>
        <xs:appinfo>
        <b:recordInfo structure=\"positional\" preserve_delimiter_for_empty_data=\"true\" suppress_trailing_delimiters=\"false\" sequence_number=\"4\" />
        </xs:appinfo>
        </xs:annotation>
        <xs:complexType mixed=\"true\">
        <xs:attribute name=\"Code\" type=\"xs:int\">
        <xs:annotation>
        <xs:appinfo>
        <b:fieldInfo sequence_number=\"1\" justification=\"left\" pos_length=\"2\" />
        </xs:appinfo>
        </xs:annotation>
        </xs:attribute>
        <xs:attribute name=\"ShortName\" type=\"xs:string\">
        <xs:annotation>
        <xs:appinfo>
        <b:fieldInfo justification=\"left\" pos_length=\"20\" sequence_number=\"2\" />
        </xs:appinfo>
        </xs:annotation>
        </xs:attribute>
        <xs:attribute name=\"ResultCode\" type=\"xs:string\">
        <xs:annotation>
        <xs:appinfo>
        <b:fieldInfo sequence_number=\"3\" justification=\"left\" pos_length=\"1\" />
        </xs:appinfo>
        </xs:annotation>
        </xs:attribute>
        </xs:complexType>
        </xs:element>
        <xs:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ResultLine\">
        <xs:annotation>
        <xs:appinfo>
        <b:recordInfo structure=\"positional\" preserve_delimiter_for_empty_data=\"true\" suppress_trailing_delimiters=\"false\" sequence_number=\"5\" />
        </xs:appinfo>
        </xs:annotation>
        <xs:complexType>
        <xs:attribute name=\"Code\" type=\"xs:int\">
        <xs:annotation>
        <xs:appinfo>
        <b:fieldInfo sequence_number=\"1\" justification=\"left\" pos_length=\"2\" />
        </xs:appinfo>
        </xs:annotation>
        </xs:attribute>
        <xs:attribute name=\"ResultCode\" type=\"xs:string\">
        <xs:annotation>
        <xs:appinfo>
        <b:fieldInfo sequence_number=\"2\" justification=\"left\" pos_length=\"1\" />
        </xs:appinfo>
        </xs:annotation>
        </xs:attribute>
        </xs:complexType>
        </xs:element>
        </xs:sequence>
        <xs:attribute name=\"Code\" type=\"xs:int\">
        <xs:annotation>
        <xs:appinfo>
        <b:fieldInfo sequence_number=\"1\" justification=\"left\" pos_length=\"2\" />
        </xs:appinfo>
        </xs:annotation>
        </xs:attribute>
        <xs:attribute name=\"Name\" type=\"xs:string\">
        <xs:annotation>
        <xs:appinfo>
        <b:fieldInfo sequence_number=\"2\" justification=\"left\" pos_length=\"50\" />
        </xs:appinfo>
        </xs:annotation>
        </xs:attribute>
        <xs:attribute name=\"LastName\" type=\"xs:string\">
        <xs:annotation>
        <xs:appinfo>
        <b:fieldInfo justification=\"left\" sequence_number=\"3\" pos_length=\"50\" />
        </xs:appinfo>
        </xs:annotation>
        </xs:attribute>
        </xs:complexType>
        </xs:element>
        </xs:sequence>
        </xs:complexType>
        </xs:element>
        [/code:1:f1800c3f70]
        The text file can contain a some \”RepeatPart\” and as can contain one \”ResultLine\”.
        But there are two more situations which I cannot disassemble.
        When one of parts \”RepeatPart\” or \”ResultLine\” is not present in a line \”Body\” 🙁

        \”ResultLine\” similar on \”RepeatPart\”, only with some null elements, but when a null element inside a line, instead of in the end parser gives out a mistake.

        • #12825

          ok, thanks for help.
          I use \”Tag Identifier\”.

          But now I have another flat file and I can’t to parse it.
          faltfile:
          [code:1:b319e106c5]
          01Name LastName 34ShortName R43ShortName R06R!
          27Name LastName 45ShortName R65ShortName R!
          99Name LastName 65ShortName R77ShortName R26ShortName R!
          02Name LastName 25R!
          03Name LastName 03ShortName R27ShortName R!
          @
          [/code:1:b319e106c5]
          symbol \”!\” – end of line
          \”@\” – end of file
          example schema:
          [code:1:b319e106c5]
          <xs:element name=\"BaseSchema\">
          <xs:annotation>
          <xs:appinfo>
          <b:recordInfo structure=\"delimited\" preserve_delimiter_for_empty_data=\"true\" suppress_trailing_delimiters=\"true\" sequence_number=\"1\" child_order=\"default\" child_delimiter_type=\"default\" escape_char_type=\"hex\" escape_char=\"0x2A\" />
          </xs:appinfo>
          </xs:annotation>
          <xs:complexType>
          <xs:sequence>
          <xs:annotation>
          <xs:appinfo>
          <b:groupInfo sequence_number=\"0\" />
          </xs:appinfo>
          </xs:annotation>
          <xs:element name=\"Body\">
          <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:sequence>
          <xs:annotation>
          <xs:appinfo>
          <b:groupInfo sequence_number=\"0\" />
          </xs:appinfo>
          </xs:annotation>
          <xs:element minOccurs=\"0\" maxOccurs=\"9\" name=\"RepeatPart\" nillable=\"true\">
          <xs:annotation>
          <xs:appinfo>
          <b:recordInfo structure=\"positional\" preserve_delimiter_for_empty_data=\"true\" suppress_trailing_delimiters=\"false\" sequence_number=\"4\" />
          </xs:appinfo>
          </xs:annotation>
          <xs:complexType mixed=\"true\">
          <xs:attribute name=\"Code\" type=\"xs:int\">
          <xs:annotation>
          <xs:appinfo>
          <b:fieldInfo sequence_number=\"1\" justification=\"left\" pos_length=\"2\" />
          </xs:appinfo>
          </xs:annotation>
          </xs:attribute>
          <xs:attribute name=\"ShortName\" type=\"xs:string\">
          <xs:annotation>
          <xs:appinfo>
          <b:fieldInfo justification=\"left\" pos_length=\"20\" sequence_number=\"2\" />
          </xs:appinfo>
          </xs:annotation>
          </xs:attribute>
          <xs:attribute name=\"ResultCode\" type=\"xs:string\">
          <xs:annotation>
          <xs:appinfo>
          <b:fieldInfo sequence_number=\"3\" justification=\"left\" pos_length=\"1\" />
          </xs:appinfo>
          </xs:annotation>
          </xs:attribute>
          </xs:complexType>
          </xs:element>
          <xs:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ResultLine\">
          <xs:annotation>
          <xs:appinfo>
          <b:recordInfo structure=\"positional\" preserve_delimiter_for_empty_data=\"true\" suppress_trailing_delimiters=\"false\" sequence_number=\"5\" />
          </xs:appinfo>
          </xs:annotation>
          <xs:complexType>
          <xs:attribute name=\"Code\" type=\"xs:int\">
          <xs:annotation>
          <xs:appinfo>
          <b:fieldInfo sequence_number=\"1\" justification=\"left\" pos_length=\"2\" />
          </xs:appinfo>
          </xs:annotation>
          </xs:attribute>
          <xs:attribute name=\"ResultCode\" type=\"xs:string\">
          <xs:annotation>
          <xs:appinfo>
          <b:fieldInfo sequence_number=\"2\" justification=\"left\" pos_length=\"1\" />
          </xs:appinfo>
          </xs:annotation>
          </xs:attribute>
          </xs:complexType>
          </xs:element>
          </xs:sequence>
          <xs:attribute name=\"Code\" type=\"xs:int\">
          <xs:annotation>
          <xs:appinfo>
          <b:fieldInfo sequence_number=\"1\" justification=\"left\" pos_length=\"2\" />
          </xs:appinfo>
          </xs:annotation>
          </xs:attribute>
          <xs:attribute name=\"Name\" type=\"xs:string\">
          <xs:annotation>
          <xs:appinfo>
          <b:fieldInfo sequence_number=\"2\" justification=\"left\" pos_length=\"50\" />
          </xs:appinfo>
          </xs:annotation>
          </xs:attribute>
          <xs:attribute name=\"LastName\" type=\"xs:string\">
          <xs:annotation>
          <xs:appinfo>
          <b:fieldInfo justification=\"left\" sequence_number=\"3\" pos_length=\"50\" />
          </xs:appinfo>
          </xs:annotation>
          </xs:attribute>
          </xs:complexType>
          </xs:element>
          </xs:sequence>
          </xs:complexType>
          </xs:element>
          [/code:1:b319e106c5]
          The text file can contain a some \”RepeatPart\” and as can contain one \”ResultLine\”.
          But there are two more situations which I cannot disassemble.
          When one of parts \”RepeatPart\” or \”ResultLine\” is not present in a line \”Body\” 🙁

          \”ResultLine\” similar on \”RepeatPart\”, only with some null elements, but when a null element inside a line, instead of in the end parser gives out a mistake.

          • #12826

            I don’t think so. You can call anything a Header and Record if you want though. Just not define it inside the Disassemblier.

            What are you trying to accomplish?

            • #12827

              The parser needs to know how to identify the result line.
              You can use the Tag property in the record definition.
              e.g.
              LField1Field2Field3Field4Field5
              LField1Field2Field3Field4Field5
              …..
              LField1Field2Field3Field4Field5
              RField1Field2

              You can define an L record Tag = \”L\” maxoccurs = unbounded and a Result record Tag = \”R\” maxoccurs = 1.
              The Tag data is not preserved

              Is there any data within each record that is specific to that record type.
              and is you file delimited or positional
              Can you post an example of the actual data you are trying to parse.

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