I have successfully recreated all other Column types in SharePoint using the SPFieldCollection.AddFieldAsXml(string xml) method. However, the same method fails for the TaxonomyFieldTypeMulti field type. The reason (possibly) being that the method is not recognizing the element in the parameter xml (Field xml schema).
Listed below are some details. Any help or suggestion as to how to recreate this field type using the provided xml schema would be really helpful.
Field xml schema:
<Field Type="TaxonomyFieldTypeMulti" ... xmlns="http://schemas.microsoft.com/sharepoint/soap/"> <Customization> <ArrayOfProperty> <Property> </Property> . . <Property> </Property> </ArrayOfProperty> </Customization> </Field>
AddFieldAsXml Method (String)
System.InvalidOperationException: There is an error in XML document (1, 2). ---> System.InvalidOperationException: was not expected. at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderNameValuePairArray.Read3_ArrayOfProperty()