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

◆ GetAttributeXsd() [2/2]

SchemaAttDef System.Xml.Schema.SchemaInfo.GetAttributeXsd ( SchemaElementDecl ed,
XmlQualifiedName qname,
XmlSchemaObject partialValidationType,
out AttributeMatchState attributeMatchState )
inlinepackage

Definition at line 192 of file SchemaInfo.cs.

193 {
194 SchemaAttDef value = null;
195 attributeMatchState = AttributeMatchState.UndeclaredAttribute;
196 if (ed != null)
197 {
198 value = ed.GetAttDef(qname);
199 if (value != null)
200 {
202 return value;
203 }
204 XmlSchemaAnyAttribute anyAttribute = ed.AnyAttribute;
205 if (anyAttribute != null)
206 {
207 if (!anyAttribute.NamespaceList.Allows(qname))
208 {
209 attributeMatchState = AttributeMatchState.ProhibitedAnyAttribute;
210 }
211 else if (anyAttribute.ProcessContentsCorrect != XmlSchemaContentProcessing.Skip)
212 {
214 {
215 if (value.Datatype.TypeCode == XmlTypeCode.Id)
216 {
217 attributeMatchState = AttributeMatchState.AnyIdAttributeFound;
218 }
219 else
220 {
222 }
223 }
224 else if (anyAttribute.ProcessContentsCorrect == XmlSchemaContentProcessing.Lax)
225 {
227 }
228 }
229 else
230 {
231 attributeMatchState = AttributeMatchState.AnyAttributeSkip;
232 }
233 }
234 else if (ed.ProhibitedAttributes.ContainsKey(qname))
235 {
236 attributeMatchState = AttributeMatchState.ProhibitedAttribute;
237 }
238 }
239 else if (partialValidationType != null)
240 {
241 if (partialValidationType is XmlSchemaAttribute xmlSchemaAttribute)
242 {
243 if (qname.Equals(xmlSchemaAttribute.QualifiedName))
244 {
245 value = xmlSchemaAttribute.AttDef;
247 }
248 else
249 {
250 attributeMatchState = AttributeMatchState.AttributeNameMismatch;
251 }
252 }
253 else
254 {
255 attributeMatchState = AttributeMatchState.ValidateAttributeInvalidCall;
256 }
257 }
258 else if (_attributeDecls.TryGetValue(qname, out value))
259 {
261 }
262 else
263 {
264 attributeMatchState = AttributeMatchState.UndeclaredElementAndAttribute;
265 }
266 return value;
267 }
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
readonly Dictionary< XmlQualifiedName, SchemaAttDef > _attributeDecls
Definition SchemaInfo.cs:25

References System.Xml.Schema.SchemaInfo._attributeDecls, System.Collections.Generic.Dictionary< TKey, TValue >.ContainsKey(), System.Xml.XmlQualifiedName.Equals(), System.Collections.Generic.Dictionary< TKey, TValue >.TryGetValue(), and System.value.

Referenced by System.Xml.Schema.SchemaInfo.GetAttributeXsd(), System.Xml.Schema.XmlSchemaValidator.ValidateAttribute(), and System.Xml.Schema.XsdValidator.ValidateStartElement().