private void FillDataColumnComplexElement (XmlSchemaElement parent, XmlSchemaElement el, DataColumn col)
{
if (targetElements.Contains (el))
return; // do nothing
string elName = XmlHelper.Decode (el.QualifiedName.Name);
if (elName == dataset.DataSetName)
// Well, why it is ArgumentException :-?
throw new ArgumentException ("Nested element must not have the same name as DataSet's name.");
if (el.Annotation != null)
HandleAnnotations (el.Annotation, true);
// If xsd:keyref xsd:key for this table exists, then don't add
// relation here manually.
else if (!DataSetDefinesKey (elName)) {
AddParentKeyColumn (parent, el, col);
RelationStructure rel = new RelationStructure ();
rel.ParentTableName = XmlHelper.Decode (parent.QualifiedName.Name);
rel.ChildTableName = elName;
rel.ParentColumnName = col.ColumnName;
rel.ChildColumnName = col.ColumnName;
rel.CreateConstraint = true;
rel.IsNested = true;
relations.Add (rel);
}
// If the element is not referenced one, the element will be handled later.
if (el.RefName == XmlQualifiedName.Empty)
ProcessDataTableElement (el);
}