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

◆ CompileLocalAttributes()

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

Definition at line 1657 of file SchemaCollectionCompiler.cs.

1658 {
1659 XmlSchemaAnyAttribute xmlSchemaAnyAttribute = baseType?.AttributeWildcard;
1660 for (int i = 0; i < attributes.Count; i++)
1661 {
1662 if (attributes[i] is XmlSchemaAttribute xmlSchemaAttribute)
1663 {
1664 if (xmlSchemaAttribute.Use != XmlSchemaUse.Prohibited)
1665 {
1667 }
1668 if (xmlSchemaAttribute.Use != XmlSchemaUse.Prohibited || (xmlSchemaAttribute.Use == XmlSchemaUse.Prohibited && derivedBy == XmlSchemaDerivationMethod.Restriction && baseType != XmlSchemaComplexType.AnyType))
1669 {
1670 if (derivedType.AttributeUses[xmlSchemaAttribute.QualifiedName] == null)
1671 {
1672 derivedType.AttributeUses.Add(xmlSchemaAttribute.QualifiedName, xmlSchemaAttribute);
1673 }
1674 else
1675 {
1677 }
1678 }
1679 else
1680 {
1682 }
1683 continue;
1684 }
1685 XmlSchemaAttributeGroupRef xmlSchemaAttributeGroupRef = (XmlSchemaAttributeGroupRef)attributes[i];
1686 XmlSchemaAttributeGroup xmlSchemaAttributeGroup = (XmlSchemaAttributeGroup)_schema.AttributeGroups[xmlSchemaAttributeGroupRef.RefName];
1687 if (xmlSchemaAttributeGroup != null)
1688 {
1690 foreach (XmlSchemaAttribute value in xmlSchemaAttributeGroup.AttributeUses.Values)
1691 {
1692 if (value.Use != XmlSchemaUse.Prohibited || (value.Use == XmlSchemaUse.Prohibited && derivedBy == XmlSchemaDerivationMethod.Restriction && baseType != XmlSchemaComplexType.AnyType))
1693 {
1694 if (derivedType.AttributeUses[value.QualifiedName] == null)
1695 {
1696 derivedType.AttributeUses.Add(value.QualifiedName, value);
1697 }
1698 else
1699 {
1701 }
1702 }
1703 else
1704 {
1705 SendValidationEvent(System.SR.Sch_AttributeIgnored, value.QualifiedName.ToString(), value, XmlSeverityType.Warning);
1706 }
1707 }
1709 }
1710 else
1711 {
1713 }
1714 }
1715 if (baseType != null)
1716 {
1717 if (derivedBy == XmlSchemaDerivationMethod.Extension)
1718 {
1720 {
1721 foreach (XmlSchemaAttribute value2 in baseType.AttributeUses.Values)
1722 {
1723 XmlSchemaAttribute xmlSchemaAttribute4 = (XmlSchemaAttribute)derivedType.AttributeUses[value2.QualifiedName];
1724 if (xmlSchemaAttribute4 != null)
1725 {
1726 if (xmlSchemaAttribute4.AttributeSchemaType != value2.AttributeSchemaType || value2.Use == XmlSchemaUse.Prohibited)
1727 {
1729 }
1730 }
1731 else
1732 {
1733 derivedType.AttributeUses.Add(value2.QualifiedName, value2);
1734 }
1735 }
1736 return;
1737 }
1738 }
1739 if (anyAttribute != null && (xmlSchemaAnyAttribute == null || !XmlSchemaAnyAttribute.IsSubset(anyAttribute, xmlSchemaAnyAttribute)))
1740 {
1742 }
1743 else
1744 {
1745 derivedType.SetAttributeWildcard(anyAttribute);
1746 }
1747 foreach (XmlSchemaAttribute value3 in baseType.AttributeUses.Values)
1748 {
1749 XmlSchemaAttribute xmlSchemaAttribute6 = (XmlSchemaAttribute)derivedType.AttributeUses[value3.QualifiedName];
1750 if (xmlSchemaAttribute6 == null)
1751 {
1752 derivedType.AttributeUses.Add(value3.QualifiedName, value3);
1753 }
1754 else if (value3.Use == XmlSchemaUse.Prohibited && xmlSchemaAttribute6.Use != XmlSchemaUse.Prohibited)
1755 {
1757 }
1758 else if (xmlSchemaAttribute6.Use != XmlSchemaUse.Prohibited && (value3.AttributeSchemaType == null || xmlSchemaAttribute6.AttributeSchemaType == null || !XmlSchemaType.IsDerivedFrom(xmlSchemaAttribute6.AttributeSchemaType, value3.AttributeSchemaType, XmlSchemaDerivationMethod.Empty)))
1759 {
1761 }
1762 }
1763 {
1764 foreach (XmlSchemaAttribute value4 in derivedType.AttributeUses.Values)
1765 {
1766 XmlSchemaAttribute xmlSchemaAttribute8 = (XmlSchemaAttribute)baseType.AttributeUses[value4.QualifiedName];
1767 if (xmlSchemaAttribute8 == null && (xmlSchemaAnyAttribute == null || !xmlSchemaAnyAttribute.Allows(value4.QualifiedName)))
1768 {
1770 }
1771 }
1772 return;
1773 }
1774 }
1775 derivedType.SetAttributeWildcard(anyAttribute);
1776 }
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_AttributeRestrictionProhibited
Definition SR.cs:1050
static string Sch_InvalidAnyAttributeRestriction
Definition SR.cs:1048
static string Sch_AttributeIgnored
Definition SR.cs:546
Definition SR.cs:7
void SendValidationEvent(string code, XmlSchemaObject source)
void CompileAttributeGroup(XmlSchemaAttributeGroup attributeGroup)
XmlSchemaAnyAttribute CompileAnyAttributeUnion(XmlSchemaAnyAttribute a, XmlSchemaAnyAttribute b)
XmlSchemaAnyAttribute CompileAnyAttributeIntersection(XmlSchemaAnyAttribute a, XmlSchemaAnyAttribute b)
XmlSchemaObjectTable AttributeGroups
Definition XmlSchema.cs:243

References System.Xml.Schema.SchemaCollectionCompiler._schema, System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Xml.Schema.XmlSchemaComplexType.AnyType, System.Xml.Schema.XmlSchema.AttributeGroups, System.Xml.Schema.SchemaCollectionCompiler.CompileAnyAttributeIntersection(), System.Xml.Schema.SchemaCollectionCompiler.CompileAnyAttributeUnion(), System.Xml.Schema.SchemaCollectionCompiler.CompileAttribute(), System.Xml.Schema.SchemaCollectionCompiler.CompileAttributeGroup(), System.Collections.CollectionBase.Count, System.Xml.Schema.XmlSchemaType.IsDerivedFrom(), System.Xml.Schema.XmlSchemaAnyAttribute.IsSubset(), System.SR.Sch_AttributeIgnored, System.SR.Sch_AttributeRestrictionInvalid, System.SR.Sch_AttributeRestrictionInvalidFromWildcard, System.SR.Sch_AttributeRestrictionProhibited, 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.SchemaCollectionCompiler.CompileComplexContentExtension(), System.Xml.Schema.SchemaCollectionCompiler.CompileComplexContentRestriction(), System.Xml.Schema.SchemaCollectionCompiler.CompileComplexType(), System.Xml.Schema.SchemaCollectionCompiler.CompileSimpleContentExtension(), and System.Xml.Schema.SchemaCollectionCompiler.CompileSimpleContentRestriction().