Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CompileLocalAttributes()

void System.Xml.Schema.Compiler.CompileLocalAttributes ( XmlSchemaComplexType baseType,
XmlSchemaComplexType derivedType,
XmlSchemaObjectCollection attributes,
XmlSchemaAnyAttribute anyAttribute,
XmlSchemaDerivationMethod derivedBy )
inlineprivate

Definition at line 1907 of file Compiler.cs.

1908 {
1909 XmlSchemaAnyAttribute xmlSchemaAnyAttribute = baseType?.AttributeWildcard;
1910 for (int i = 0; i < attributes.Count; i++)
1911 {
1912 if (attributes[i] is XmlSchemaAttribute xmlSchemaAttribute)
1913 {
1914 if (xmlSchemaAttribute.Use != XmlSchemaUse.Prohibited)
1915 {
1917 }
1918 if (xmlSchemaAttribute.Use != XmlSchemaUse.Prohibited || (xmlSchemaAttribute.Use == XmlSchemaUse.Prohibited && derivedBy == XmlSchemaDerivationMethod.Restriction && baseType != XmlSchemaComplexType.AnyType))
1919 {
1920 if (derivedType.AttributeUses[xmlSchemaAttribute.QualifiedName] == null)
1921 {
1922 derivedType.AttributeUses.Add(xmlSchemaAttribute.QualifiedName, xmlSchemaAttribute);
1923 }
1924 else
1925 {
1927 }
1928 }
1929 else
1930 {
1932 }
1933 continue;
1934 }
1935 XmlSchemaAttributeGroupRef xmlSchemaAttributeGroupRef = (XmlSchemaAttributeGroupRef)attributes[i];
1936 XmlSchemaAttributeGroup xmlSchemaAttributeGroup = (XmlSchemaAttributeGroup)_attributeGroups[xmlSchemaAttributeGroupRef.RefName];
1937 if (xmlSchemaAttributeGroup != null)
1938 {
1940 foreach (XmlSchemaAttribute value in xmlSchemaAttributeGroup.AttributeUses.Values)
1941 {
1942 if (value.Use != XmlSchemaUse.Prohibited || (value.Use == XmlSchemaUse.Prohibited && derivedBy == XmlSchemaDerivationMethod.Restriction && baseType != XmlSchemaComplexType.AnyType))
1943 {
1944 if (derivedType.AttributeUses[value.QualifiedName] == null)
1945 {
1946 derivedType.AttributeUses.Add(value.QualifiedName, value);
1947 }
1948 else
1949 {
1951 }
1952 }
1953 else
1954 {
1955 SendValidationEvent(System.SR.Sch_AttributeIgnored, value.QualifiedName.ToString(), value, XmlSeverityType.Warning);
1956 }
1957 }
1959 }
1960 else
1961 {
1963 }
1964 }
1965 if (baseType != null)
1966 {
1967 if (derivedBy == XmlSchemaDerivationMethod.Extension)
1968 {
1970 {
1971 foreach (XmlSchemaAttribute value2 in baseType.AttributeUses.Values)
1972 {
1973 XmlSchemaAttribute xmlSchemaAttribute4 = (XmlSchemaAttribute)derivedType.AttributeUses[value2.QualifiedName];
1974 if (xmlSchemaAttribute4 == null)
1975 {
1976 derivedType.AttributeUses.Add(value2.QualifiedName, value2);
1977 }
1978 else if (value2.Use != XmlSchemaUse.Prohibited && xmlSchemaAttribute4.AttributeSchemaType != value2.AttributeSchemaType)
1979 {
1981 }
1982 }
1983 return;
1984 }
1985 }
1987 {
1989 }
1990 else
1991 {
1992 derivedType.SetAttributeWildcard(anyAttribute);
1993 }
1994 foreach (XmlSchemaAttribute value3 in baseType.AttributeUses.Values)
1995 {
1996 XmlSchemaAttribute xmlSchemaAttribute6 = (XmlSchemaAttribute)derivedType.AttributeUses[value3.QualifiedName];
1997 if (xmlSchemaAttribute6 == null)
1998 {
1999 derivedType.AttributeUses.Add(value3.QualifiedName, value3);
2000 }
2001 else if (value3.Use == XmlSchemaUse.Prohibited && xmlSchemaAttribute6.Use != XmlSchemaUse.Prohibited)
2002 {
2004 }
2005 else if (value3.Use == XmlSchemaUse.Required && xmlSchemaAttribute6.Use != XmlSchemaUse.Required)
2006 {
2008 }
2009 else if (xmlSchemaAttribute6.Use != XmlSchemaUse.Prohibited)
2010 {
2011 if (value3.AttributeSchemaType == null || xmlSchemaAttribute6.AttributeSchemaType == null || !XmlSchemaType.IsDerivedFrom(xmlSchemaAttribute6.AttributeSchemaType, value3.AttributeSchemaType, XmlSchemaDerivationMethod.Empty))
2012 {
2014 }
2015 else if (!IsFixedEqual(value3.AttDef, xmlSchemaAttribute6.AttDef))
2016 {
2018 }
2019 }
2020 }
2021 {
2022 foreach (XmlSchemaAttribute value4 in derivedType.AttributeUses.Values)
2023 {
2024 XmlSchemaAttribute xmlSchemaAttribute8 = (XmlSchemaAttribute)baseType.AttributeUses[value4.QualifiedName];
2025 if (xmlSchemaAttribute8 == null && (xmlSchemaAnyAttribute == null || !xmlSchemaAnyAttribute.Allows(value4.QualifiedName)))
2026 {
2028 }
2029 }
2030 return;
2031 }
2032 }
2033 derivedType.SetAttributeWildcard(anyAttribute);
2034 }
void Add(TKey key, TValue value)
static string Sch_UndefAttributeGroupRef
Definition SR.cs:1044
static string Sch_AttributeRestrictionInvalid
Definition SR.cs:1052
static string Sch_DupAttributeUse
Definition SR.cs:986
static string Sch_AttributeRestrictionInvalidFromWildcard
Definition SR.cs:1058
static string Sch_InvalidAttributeExtension
Definition SR.cs:1046
static string Sch_AttributeFixedInvalid
Definition SR.cs:1054
static string Sch_AttributeRestrictionProhibited
Definition SR.cs:1050
static string Sch_InvalidAnyAttributeRestriction
Definition SR.cs:1048
static string Sch_AttributeUseInvalid
Definition SR.cs:1056
static string Sch_AttributeIgnored
Definition SR.cs:546
Definition SR.cs:7
void SendValidationEvent(string code, XmlSchemaObject source)
bool IsProcessContentsRestricted(XmlSchemaComplexType baseType, XmlSchemaAnyAttribute derivedAttributeWildcard, XmlSchemaAnyAttribute baseAttributeWildcard)
Definition Compiler.cs:2084
XmlSchemaAnyAttribute CompileAnyAttributeUnion(XmlSchemaAnyAttribute a, XmlSchemaAnyAttribute b)
Definition Compiler.cs:2097
void CompileAttributeGroup(XmlSchemaAttributeGroup attributeGroup)
Definition Compiler.cs:1841
XmlSchemaAnyAttribute CompileAnyAttributeIntersection(XmlSchemaAnyAttribute a, XmlSchemaAnyAttribute b)
Definition Compiler.cs:2115
void CompileAttribute(XmlSchemaAttribute xa)
Definition Compiler.cs:2133
bool IsFixedEqual(SchemaDeclBase baseDecl, SchemaDeclBase derivedDecl)
Definition Compiler.cs:2770
readonly XmlSchemaObjectTable _attributeGroups
Definition Compiler.cs:14

References System.Xml.Schema.Compiler._attributeGroups, System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Xml.Schema.XmlSchemaComplexType.AnyType, System.Xml.Schema.Compiler.CompileAnyAttributeIntersection(), System.Xml.Schema.Compiler.CompileAnyAttributeUnion(), System.Xml.Schema.Compiler.CompileAttribute(), System.Xml.Schema.Compiler.CompileAttributeGroup(), System.Collections.CollectionBase.Count, System.Xml.Schema.XmlSchemaType.IsDerivedFrom(), System.Xml.Schema.Compiler.IsFixedEqual(), System.Xml.Schema.Compiler.IsProcessContentsRestricted(), System.Xml.Schema.XmlSchemaAnyAttribute.IsSubset(), System.SR.Sch_AttributeFixedInvalid, System.SR.Sch_AttributeIgnored, System.SR.Sch_AttributeRestrictionInvalid, System.SR.Sch_AttributeRestrictionInvalidFromWildcard, System.SR.Sch_AttributeRestrictionProhibited, System.SR.Sch_AttributeUseInvalid, System.SR.Sch_DupAttributeUse, System.SR.Sch_InvalidAnyAttributeRestriction, System.SR.Sch_InvalidAttributeExtension, System.SR.Sch_UndefAttributeGroupRef, System.Xml.Schema.BaseProcessor.SendValidationEvent(), System.value, and System.Collections.Generic.Dictionary< TKey, TValue >.Values.

Referenced by System.Xml.Schema.Compiler.CompileComplexContentExtension(), System.Xml.Schema.Compiler.CompileComplexContentRestriction(), System.Xml.Schema.Compiler.CompileComplexType(), System.Xml.Schema.Compiler.CompileSimpleContentExtension(), and System.Xml.Schema.Compiler.CompileSimpleContentRestriction().