I am being passed a large chunk of XML for processing in BizTalk. The xml is mainly in the form:
<FieldItem>
<Name>EmploymentStatus</Name>
<Value xsi:type="xsd:string">1</Value>
</FieldItem>
However, occasionally a name value pair becomes more complex, looking something like this:
<FieldItem>
<Name>EducationAndQualifications</Name>
<Value xsi:type="RepeatingFieldArray">
<Fields>
<RepeatingField>
<Items>
<FieldItem>
<Name>Qualification</Name>
<Value xsi:type="xsd:string">umbraco</Value>
</FieldItem>
<FieldItem>
<Name>Establishment</Name>
<Value xsi:type="xsd:string">IBM</Value>
</FieldItem>
<FieldItem>
<Name>DateAchieved</Name>
<Value xsi:type="xsd:string">June 2011</Value>
</FieldItem>
</Items>
</RepeatingField>
</Fields>
</Value>
</FieldItem>
I have tried generating a schema via BizTalks Generated Items Wizard but it can't cope with the types changing and then the additional repeating fields which may or may not be there.
So I am looking for advice/guidance on the best way forward on this. Is it possible to create a schema that BizTalk will like to deal with this? Or, the solution I'm favouring at the moment, should I create a custom pipeline component that splits this out into separate messages?
Thanks for your time.
UPDATE
If I create the following schema:
<?xml version="1.0" encoding="utf-16" ?>
<xsd:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="FormData">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="FormName" type="xsd:string" />
<xsd:element name="FormInstanceId" type="xsd:string" />
<xsd:element name="Status" type="xsd:string" />
<xsd:element name="Data">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" name="FieldItem">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Name" type="xsd:string" />
<xsd:element minOccurs="0" maxOccurs="unbounded" name="Value" nillable="true" type="xsd:anyType" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
I get the following error:
This is an invalid xsi:type 'RepeatingFieldArray'
So I am still leaning towards writing some code to sort this all out ....