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

◆ ValidateElement()

void System.Xml.DocumentSchemaValidator.ValidateElement ( )
inlineprivate

Definition at line 312 of file DocumentSchemaValidator.cs.

313 {
315 XmlElement xmlElement = _currentNode as XmlElement;
316 XmlAttributeCollection attributes = xmlElement.Attributes;
317 XmlAttribute xmlAttribute = null;
318 string xsiNil = null;
319 string xsiType = null;
320 for (int i = 0; i < attributes.Count; i++)
321 {
322 xmlAttribute = attributes[i];
323 string namespaceURI = xmlAttribute.NamespaceURI;
324 string localName = xmlAttribute.LocalName;
325 if (Ref.Equal(namespaceURI, _nsXsi))
326 {
327 if (Ref.Equal(localName, _xsiType))
328 {
329 xsiType = xmlAttribute.Value;
330 }
331 else if (Ref.Equal(localName, _xsiNil))
332 {
333 xsiNil = xmlAttribute.Value;
334 }
335 }
336 else if (Ref.Equal(namespaceURI, _nsXmlNs))
337 {
338 _nsManager.AddNamespace((xmlAttribute.Prefix.Length == 0) ? string.Empty : xmlAttribute.LocalName, xmlAttribute.Value);
339 }
340 }
341 _validator.ValidateElement(xmlElement.LocalName, xmlElement.NamespaceURI, _schemaInfo, xsiType, xsiNil, null, null);
344 for (XmlNode xmlNode = xmlElement.FirstChild; xmlNode != null; xmlNode = xmlNode.NextSibling)
345 {
347 }
351 {
354 {
356 xmlElement.AppendChild(newChild);
357 }
358 }
360 }
readonly XmlNamespaceManager _nsManager
void ValidateAttributes(XmlElement elementNode)
void ValidateElement(string localName, string namespaceUri, XmlSchemaInfo? schemaInfo)
object? ValidateEndElement(XmlSchemaInfo? schemaInfo)
void ValidateEndOfAttributes(XmlSchemaInfo? schemaInfo)
virtual XmlText CreateTextNode(string? text)
XmlName AddXmlName(string prefix, string localName, string namespaceURI, IXmlSchemaInfo schemaInfo)
virtual void AddNamespace(string prefix, string uri)

References System.Xml.DocumentSchemaValidator._currentNode, System.Xml.DocumentSchemaValidator._document, System.Xml.DocumentSchemaValidator._nsManager, System.Xml.DocumentSchemaValidator._nsXmlNs, System.Xml.DocumentSchemaValidator._nsXsi, System.Xml.DocumentSchemaValidator._psviAugmentation, System.Xml.DocumentSchemaValidator._schemaInfo, System.Xml.DocumentSchemaValidator._validator, System.Xml.DocumentSchemaValidator._xsiNil, System.Xml.DocumentSchemaValidator._xsiType, System.Xml.XmlNamespaceManager.AddNamespace(), System.Xml.XmlDocument.AddXmlName(), System.Xml.XmlAttributeCollection.Count, System.Xml.XmlDocument.CreateTextNode(), System.Xml.Schema.SchemaDeclBase.DefaultValueRaw, System.Xml.Dictionary, System.Xml.Schema.XmlSchemaElement.ElementDecl, System.Xml.Ref.Equal(), System.Xml.Schema.XmlSchemaInfo.IsDefault, System.Xml.XmlNamespaceManager.PopScope(), System.Xml.XmlNamespaceManager.PushScope(), System.Xml.Schema.XmlSchemaInfo.SchemaElement, System.Xml.DocumentSchemaValidator.ValidateAttributes(), System.Xml.Schema.XmlSchemaValidator.ValidateElement(), System.Xml.Schema.XmlSchemaValidator.ValidateEndElement(), System.Xml.Schema.XmlSchemaValidator.ValidateEndOfAttributes(), and System.Xml.DocumentSchemaValidator.ValidateNode().

Referenced by System.Xml.DocumentSchemaValidator.ValidateNode().