Need help on How to Not assemble useless incoming data

Home Page Forums BizTalk 2004 – BizTalk 2010 Need help on How to Not assemble useless incoming data

Viewing 1 reply thread
  • Author
    Posts
    • #12709

      Hi,

      I have an incoming flat file I am assembling to XML. The problem is it contains useless data that I do not want to disassemble.

      The incoming file looks like this
      [quote:0b3ad8c450]1100705
      1100705SAG01-0001 PHTCPY 3333
      1100705SAG01-0002 PHTCPY 4444
      1100705SAG01-0006 PHTCPY 8888
      1100705SAG01-0006 PHTCPY 9999
      1100706
      1100706SAG01-0005 XXXXXX 1111
      1100706SAG01-0006 PHTCPY 2222
      1100706SAG01-0006 PHTCPY 9999
      1100708
      1100708SAG01-0003 PHTCPY 5555

      [/quote:0b3ad8c450]

      The full lines I want, the partial lines I don’t want.

      I am assembling them just fine but the partial lines only partially fill the XML.

      Any help is greatly appreciated.

      Thanks

      Scott

    • #12710

      I am using a map but how can I tell the map to ignore the errant records?

      • #12711

        That solution worked perfectly, just like magic.

        I don’t understand how since I didn’t link any incoming fields to the script functoid.

        Thank You

        Scott

        • #12712

          As far as I am aware the Flat File disassembler cannot ignore records.
          Your options would be to write your own disassembler or deal with the errant records using a map

          • #12713

            You can create a map with the same input and output schema
            Add a scripting functoid with Script Type = Inline Xslt and copy this code

            [code:1:5d60a03c92]<xsl:copy>
            <xsl:for-each select=\"*\">
            <xsl:if test=\"child::*[position()=2]/text()\">
            <xsl:copy-of select=\".\"/>
            </xsl:if>
            </xsl:for-each>
            </xsl:copy>[/code:1:5d60a03c92]

            Connect the scripting functoid output to the root node of the destination schema.

            The assumption is that field 1 of each record is present and field 2 is missing from the records you wish to remove. If this is not the case you can change the position() value.

            • #12714

              The Mapper is just a GUI developer tool for producing XSLT. It uses schema properties, links and functoids to generate XSLT. You can see this if you do a Validate Map and check the output files.

              The inline XSLT functoid just dumps your XSLT into the compiled XSLT, Because you cannot pass parameters to inline XSLT there is no point in having an input link. The output link is required so the compiler knows where to place your XSLT in the output.

              Greg

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