Re: Splitting Records using Biztalk

Home Page Forums BizTalk 2004 – BizTalk 2010 Splitting Records using Biztalk Re: Splitting Records using Biztalk

#16733

You need to create an envelope and document schema.

Here is an example with both envelope and document in the same schema file. You should be able to deploy this schema and use the standard XmlReceive pipleine to debatch your file into separate <Color> messages 

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:annotation>
    <xs:appinfo>
      <b:schemaInfo is_envelope="yes" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="Colors">
    <xs:annotation>
      <xs:appinfo>
        <b:recordInfo body_xpath="/*[local-name()='Colors' and namespace-uri()='']" />
      </xs:appinfo>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="Color" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Color" type="ColorType" />
  <xs:complexType name="ColorType">
    <xs:sequence>
      <xs:element name="FrontColor" type="xs:string" />
      <xs:element name="BackColor" type="xs:string" />
    </xs:sequence>
  </xs:complexType>
</xs:schema> 

 

You may also have problems without any namespaces in your xml. The message type of the envelope will be #Colors and the message type of the document will be #Color. If you have any other schemas deployed wuth the same root nodes and without a namespace things will become difficult.