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

◆ GetAttributeXdr()

SchemaAttDef System.Xml.Schema.SchemaInfo.GetAttributeXdr ( SchemaElementDecl ed,
XmlQualifiedName qname )
inlinepackage

Definition at line 171 of file SchemaInfo.cs.

172 {
173 SchemaAttDef value = null;
174 if (ed != null)
175 {
176 value = ed.GetAttDef(qname);
177 if (value == null)
178 {
179 if (!ed.ContentValidator.IsOpen || qname.Namespace.Length == 0)
180 {
181 throw new XmlSchemaException(System.SR.Sch_UndeclaredAttribute, qname.ToString());
182 }
183 if (!_attributeDecls.TryGetValue(qname, out value) && _targetNamespaces.ContainsKey(qname.Namespace))
184 {
185 throw new XmlSchemaException(System.SR.Sch_UndeclaredAttribute, qname.ToString());
186 }
187 }
188 }
189 return value;
190 }
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
static string Sch_UndeclaredAttribute
Definition SR.cs:414
Definition SR.cs:7
readonly Dictionary< XmlQualifiedName, SchemaAttDef > _attributeDecls
Definition SchemaInfo.cs:25
readonly Dictionary< string, bool > _targetNamespaces
Definition SchemaInfo.cs:23

References System.Xml.Schema.SchemaInfo._attributeDecls, System.Xml.Schema.SchemaInfo._targetNamespaces, System.Collections.Generic.Dictionary< TKey, TValue >.ContainsKey(), System.Xml.XmlQualifiedName.Namespace, System.SR.Sch_UndeclaredAttribute, System.Xml.XmlQualifiedName.ToString(), System.Collections.Generic.Dictionary< TKey, TValue >.TryGetValue(), and System.value.

Referenced by System.Xml.Schema.XdrValidator.ValidateStartElement().