internal static void ImportXsdElement(IfcDoc.Schema.XSD.element sub, DocEntity docEntity, bool list)
{
DocAttribute docAttr = new DocAttribute();
docEntity.Attributes.Add(docAttr);
if (!String.IsNullOrEmpty(sub.name))
{
docAttr.Name = sub.name;
}
else
{
docAttr.Name = sub.reftype;
}
if (!String.IsNullOrEmpty(sub.type))
{
docAttr.DefinedType = sub.type;
}
else
{
docAttr.DefinedType = sub.reftype;
}
// list or set??...
if (list || sub.minOccurs != null)
{
if (list || sub.maxOccurs != null)
{
// list
if (list || sub.maxOccurs == "unbounded")
{
docAttr.AggregationType = 1; // list
if (!String.IsNullOrEmpty(sub.minOccurs))
{
docAttr.AggregationLower = sub.minOccurs;
}
else
{
docAttr.AggregationLower = "0";
}
docAttr.AggregationUpper = "?";
}
}
else if (sub.minOccurs == "0")
{
docAttr.IsOptional = true;
}
}
docAttr.Documentation = ImportXsdAnnotation(sub.annotation);
}