Skip to content

Commit 34c9bf7

Browse files
committed
check for Reference naming on global elements
1 parent 37e6641 commit 34c9bf7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Colectica.DDISchemaCheck.Checks/EnsureReferencability.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,18 @@ public static string GetTestResult(XmlSchemaSet schema)
7676

7777
}
7878
}
79+
}
80+
81+
foreach(var element in schema.GlobalElements.Values.OfType<XmlSchemaElement>())
82+
{
83+
XmlSchemaComplexType ct = element.ElementSchemaType as XmlSchemaComplexType;
84+
if (ct == null) { continue; }
7985

8086
if (ct.AttributeUses.Values.Cast<XmlSchemaAttribute>().Any(a => a.Name == "isReference"))
8187
{
8288
if (!element.QualifiedName.Name.EndsWith("Reference"))
8389
{
84-
noReferencePrefix.Add(tuple);
90+
noReferencePrefix.Add(new Tuple<XmlQualifiedName, XmlSchemaElement>(element.QualifiedName,element));
8591
}
8692
}
8793
}

0 commit comments

Comments
 (0)