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

◆ ValidateSingleElement()

void System.Xml.DocumentSchemaValidator.ValidateSingleElement ( XmlElement elementNode,
bool skipToEnd,
XmlSchemaInfo newSchemaInfo )
inlineprivate

Definition at line 590 of file DocumentSchemaValidator.cs.

591 {
593 XmlAttributeCollection attributes = elementNode.Attributes;
594 XmlAttribute xmlAttribute = null;
595 string xsiNil = null;
596 string xsiType = null;
597 for (int i = 0; i < attributes.Count; i++)
598 {
599 xmlAttribute = attributes[i];
600 string namespaceURI = xmlAttribute.NamespaceURI;
601 string localName = xmlAttribute.LocalName;
602 if (Ref.Equal(namespaceURI, _nsXsi))
603 {
604 if (Ref.Equal(localName, _xsiType))
605 {
606 xsiType = xmlAttribute.Value;
607 }
608 else if (Ref.Equal(localName, _xsiNil))
609 {
610 xsiNil = xmlAttribute.Value;
611 }
612 }
613 else if (Ref.Equal(namespaceURI, _nsXmlNs))
614 {
615 _nsManager.AddNamespace((xmlAttribute.Prefix.Length == 0) ? string.Empty : xmlAttribute.LocalName, xmlAttribute.Value);
616 }
617 }
618 _validator.ValidateElement(elementNode.LocalName, elementNode.NamespaceURI, newSchemaInfo, xsiType, xsiNil, null, null);
619 if (skipToEnd)
620 {
624 }
625 }
readonly XmlNamespaceManager _nsManager
void SkipToEndElement(XmlSchemaInfo? schemaInfo)
void ValidateElement(string localName, string namespaceUri, XmlSchemaInfo? schemaInfo)
void ValidateEndOfAttributes(XmlSchemaInfo? schemaInfo)
virtual void AddNamespace(string prefix, string uri)

References System.Xml.DocumentSchemaValidator._nsManager, System.Xml.DocumentSchemaValidator._nsXmlNs, System.Xml.DocumentSchemaValidator._nsXsi, System.Xml.DocumentSchemaValidator._validator, System.Xml.DocumentSchemaValidator._xsiNil, System.Xml.DocumentSchemaValidator._xsiType, System.Xml.XmlNamespaceManager.AddNamespace(), System.Xml.XmlAttributeCollection.Count, System.Xml.Ref.Equal(), System.Xml.XmlNamespaceManager.PopScope(), System.Xml.XmlNamespaceManager.PushScope(), System.Xml.Schema.XmlSchemaValidator.SkipToEndElement(), System.Xml.Schema.XmlSchemaValidator.ValidateElement(), and System.Xml.Schema.XmlSchemaValidator.ValidateEndOfAttributes().

Referenced by System.Xml.DocumentSchemaValidator.GetTypeFromAncestors(), and System.Xml.DocumentSchemaValidator.ValidateChildrenTillNextAncestor().