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

◆ LoadElementNode()

XmlElement System.Xml.Schema.Parser.LoadElementNode ( bool root)
inlineprivate

Definition at line 298 of file Parser.cs.

299 {
300 XmlReader reader = _reader;
301 bool isEmptyElement = reader.IsEmptyElement;
302 XmlElement xmlElement = _dummyDocument.CreateElement(reader.Prefix, reader.LocalName, reader.NamespaceURI);
304 if (root)
305 {
307 }
308 else
309 {
310 XmlAttributeCollection attributes = xmlElement.Attributes;
311 if (reader.MoveToFirstAttribute())
312 {
313 do
314 {
315 if (Ref.Equal(reader.NamespaceURI, _schemaNames.NsXmlNs))
316 {
317 _annotationNSManager.AddNamespace((reader.Prefix.Length == 0) ? string.Empty : _reader.LocalName, _reader.Value);
318 }
319 XmlAttribute node = LoadAttributeNode();
320 attributes.Append(node);
321 }
322 while (reader.MoveToNextAttribute());
323 }
324 reader.MoveToElement();
325 string text = _annotationNSManager.LookupNamespace(reader.Prefix);
326 if (text == null)
327 {
328 XmlAttribute node2 = CreateXmlNsAttribute(reader.Prefix, _namespaceManager.LookupNamespace(reader.Prefix));
329 attributes.Append(node2);
330 }
331 else if (text.Length == 0)
332 {
333 string text2 = _namespaceManager.LookupNamespace(reader.Prefix);
334 if (text2 != string.Empty)
335 {
336 XmlAttribute node3 = CreateXmlNsAttribute(reader.Prefix, text2);
337 attributes.Append(node3);
338 }
339 }
340 while (reader.MoveToNextAttribute())
341 {
342 if (reader.Prefix.Length != 0)
343 {
344 string text3 = _annotationNSManager.LookupNamespace(reader.Prefix);
345 if (text3 == null)
346 {
347 XmlAttribute node4 = CreateXmlNsAttribute(reader.Prefix, _namespaceManager.LookupNamespace(reader.Prefix));
348 attributes.Append(node4);
349 }
350 }
351 }
352 reader.MoveToElement();
354 if (!reader.IsEmptyElement)
355 {
357 }
358 }
359 return xmlElement;
360 }
readonly SchemaNames _schemaNames
Definition Parser.cs:12
XmlAttribute CreateXmlNsAttribute(string prefix, string value)
Definition Parser.cs:362
XmlNamespaceManager _namespaceManager
Definition Parser.cs:16
readonly XmlDocument _dummyDocument
Definition Parser.cs:36
XmlAttribute LoadAttributeNode()
Definition Parser.cs:370
XmlNamespaceManager _annotationNSManager
Definition Parser.cs:42
XmlElement CreateElement(string name)
virtual ? string LookupNamespace(string prefix)
virtual void AddNamespace(string prefix, string uri)
virtual ? XmlNode AppendChild(XmlNode newChild)
Definition XmlNode.cs:739
virtual ? XmlAttributeCollection Attributes
Definition XmlNode.cs:106

References System.Xml.Schema.Parser._annotationNSManager, System.Xml.Schema.Parser._dummyDocument, System.Xml.Schema.Parser._namespaceManager, System.Xml.Schema.Parser._parentNode, System.Xml.Schema.Parser._reader, System.Xml.Schema.Parser._schemaNames, System.Xml.XmlNamespaceManager.AddNamespace(), System.Xml.XmlAttributeCollection.Append(), System.Xml.XmlNode.AppendChild(), System.Xml.XmlDocument.CreateElement(), System.Xml.Schema.Parser.CreateXmlNsAttribute(), System.Xml.Dictionary, System.Xml.Ref.Equal(), System.Xml.XmlReader.IsEmptyElement, System.Xml.Schema.Parser.LoadAttributeNode(), System.Xml.XmlReader.LocalName, System.Xml.XmlNamespaceManager.LookupNamespace(), System.Xml.XmlReader.MoveToElement(), System.Xml.XmlReader.MoveToFirstAttribute(), System.Xml.XmlReader.MoveToNextAttribute(), System.Xml.XmlReader.NamespaceURI, System.Xml.Schema.SchemaNames.NsXmlNs, System.Xml.XmlReader.Prefix, System.text, and System.Xml.XmlReader.Value.

Referenced by System.Xml.Schema.Parser.ProcessAppInfoDocMarkup().