XML Debatching

Viewing 1 reply thread
  • Author
    Posts
    • #27967

      Hello,

      I’m wondering whether someone can assist with a task I believe should be quite easy, but has left me with no hair.

      Please take this file as an example.  As you can see the file has multiple <DESADV> segments.  My task is to strip these out and map into individual xml documents.

      <?xml version=”1.0″?>
      <DESPATCH>
      <HEAD>
      <FileGen>9902345</FileGen>
      <Date>2007120414</Date>
      <Type>DESPATCH</Type>
      <Version>D96A</Version>
      <DESADV>
      <ANA>5000000000000</ANA>
      <Customer>BIZTALK</Customer>
      <Order_Number>PO66883</Order_Number>
      <DCL>
      <Item>BB0001</Item>
      <Description>Please</Description>
      <Quantity>55</Quantity>
      </DCL>
      </DESADV>
      <DESADV>
      <ANA>5000000000000</ANA>
      <Customer>BIZTALK</Customer>
      <Order_Number>PO66887</Order_Number>
      <DCL>
      <Item>BB0001</Item>
      <Description>Help</Description>
      <Quantity>66</Quantity>
      </DCL>
      </DESADV>
      <DESADV>
      <ANA>5000000000000</ANA>
      <Customer>BIZTALK</Customer>
      <Order_Number>PO66883</Order_Number>
      <DCL>
      <Item>BB0044</Item>
      <Description>Me</Description>
      <Quantity>77</Quantity>
      </DCL>
      </DESADV>
      </HEAD>
      </DESPATCH>

      As you can see the file has multiple <DESADV> segments.  My task is to strip these out and map into individual xml documents.

      Say for example, in my send location 3 files would be produced with the following format.

      <?xml version=”1.0″?>
      <Header>
      <ANA>5000000000000</ANA>
      <Customer>BIZTALK</Customer>
      <Order_Number>PO66883</Order_Number>
      <Lines>
      <Item>BB0044</Item>
      <Description>Me</Description>
      <Quantity>77</Quantity>
      </Lines>
      </Header>

      Prevously I have been able to complete this by creating an Envelope schema and setting the Body XPath on the HEAD node.  But with the above example this fails to work, I believe this is due to the fields that appear after the HEAD node (FileGen/Date/Type) as so on.  As I keep getting errors relating to these fields and no schema deployed with in BizTalk.

      I have trawled of the internet and all examples for Enveloping appear to show documents with the following structure.

      <Record>

      <Orders>

      <Order>

      </Order>

      </Orders>

      </Record>

      I’ve even read that the is possible by creating a custom receive pipeline and using the XML Disassembler option.  But after reading on the web using these option only validates the contents of the files against a schema already deployed, it does not actually split the contents.

      I hoping someone will be able to assist, as these has rattled me brains for nearly 2 days.

      Thanks in advance

       

    • #28022

      Hi. How to do EDI batching in Biztalk server 2013.

Viewing 1 reply thread
  • The forum ‘BizTalk 2013 & BizTalk 2013 R2’ is closed to new topics and replies.