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

◆ GetUnspecifiedDefaultAttributes() [2/2]

void System.Xml.Schema.XmlSchemaValidator.GetUnspecifiedDefaultAttributes ( ArrayList defaultAttributes,
bool createNodeData )
inlinepackage

Definition at line 1036 of file XmlSchemaValidator.cs.

1037 {
1038 _currentState = ValidatorState.Attribute;
1039 SchemaElementDecl elementDecl = _context.ElementDecl;
1040 if (elementDecl == null || !elementDecl.HasDefaultAttribute)
1041 {
1042 return;
1043 }
1044 for (int i = 0; i < elementDecl.DefaultAttDefs.Count; i++)
1045 {
1046 SchemaAttDef schemaAttDef = (SchemaAttDef)elementDecl.DefaultAttDefs[i];
1047 if (_attPresence.Contains(schemaAttDef.Name) || schemaAttDef.DefaultValueTyped == null)
1048 {
1049 continue;
1050 }
1051 string text = _nameTable.Add(schemaAttDef.Name.Namespace);
1052 string text2 = string.Empty;
1053 if (text.Length > 0)
1054 {
1056 if (text2 == null || text2.Length == 0)
1057 {
1059 {
1060 schemaAttDef.Name.ToString(),
1061 QNameString(_context.LocalName, _context.Namespace)
1062 });
1063 continue;
1064 }
1065 }
1066 XmlSchemaDatatype datatype = schemaAttDef.Datatype;
1067 if (createNodeData)
1068 {
1069 ValidatingReaderNodeData validatingReaderNodeData = new ValidatingReaderNodeData();
1073 validatingReaderNodeData.NodeType = XmlNodeType.Attribute;
1074 AttributePSVIInfo attributePSVIInfo = new AttributePSVIInfo();
1075 XmlSchemaInfo attributeSchemaInfo = attributePSVIInfo.attributeSchemaInfo;
1076 if (schemaAttDef.Datatype.Variety == XmlSchemaDatatypeVariety.Union)
1077 {
1078 XsdSimpleValue xsdSimpleValue = schemaAttDef.DefaultValueTyped as XsdSimpleValue;
1080 datatype = xsdSimpleValue.XmlType.Datatype;
1082 }
1083 else
1084 {
1086 }
1088 attributeSchemaInfo.Validity = XmlSchemaValidity.Valid;
1091 validatingReaderNodeData.RawValue = attributeSchemaInfo.XmlType.ValueConverter.ToString(attributePSVIInfo.typedAttributeValue);
1093 defaultAttributes.Add(validatingReaderNodeData);
1094 }
1095 else
1096 {
1097 defaultAttributes.Add(schemaAttDef.SchemaAttribute);
1098 }
1099 CheckTokenizedTypes(datatype, schemaAttDef.DefaultValueTyped, attrValue: true);
1101 {
1102 AttributeIdentityConstraints(schemaAttDef.Name.Name, schemaAttDef.Name.Namespace, schemaAttDef.DefaultValueTyped, schemaAttDef.DefaultValueRaw, datatype);
1103 }
1104 }
1105 }
virtual int Add(object? value)
virtual bool Contains(object key)
Definition Hashtable.cs:719
static string Sch_DefaultAttributeNotApplied
Definition SR.cs:1166
Definition SR.cs:7
string GetDefaultAttributePrefix(string attributeNS)
void CheckTokenizedTypes(XmlSchemaDatatype dtype, object typedValue, bool attrValue)
void AttributeIdentityConstraints(string name, string ns, object obj, string sobj, XmlSchemaDatatype datatype)
string Add(char[] array, int offset, int length)

References System.Xml.Schema.XmlSchemaValidator._attPresence, System.Xml.Schema.XmlSchemaValidator._context, System.Xml.Schema.XmlSchemaValidator._currentState, System.Xml.Schema.XmlSchemaValidator._nameTable, System.Xml.XmlNameTable.Add(), System.Collections.ArrayList.Add(), System.Xml.Schema.XmlSchemaValidator.AttributeIdentityConstraints(), System.Xml.Schema.XmlSchemaValidator.CheckTokenizedTypes(), System.Collections.Hashtable.Contains(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Xml.Dictionary, System.Xml.Schema.ValidationState.ElementDecl, System.Xml.Schema.XmlSchemaValidator.GetDefaultAttributePrefix(), System.Xml.Schema.XmlSchemaValidator.HasIdentityConstraints, System.SR.Sch_DefaultAttributeNotApplied, System.Xml.Schema.XmlSchemaValidator.SendValidationEvent(), System.text, System.Xml.Schema.XmlValueConverter.ToString(), System.Xml.Schema.XmlSchemaType.ValueConverter, and System.Xml.Schema.XmlSchemaInfo.XmlType.