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

◆ GetNamespace()

override string System.Xml.DocumentXPathNavigator.GetNamespace ( string name)
inlinevirtual

Reimplemented from System.Xml.XPath.XPathNavigator.

Definition at line 359 of file DocumentXPathNavigator.cs.

360 {
361 XmlNode xmlNode = _source;
362 while (xmlNode != null && xmlNode.NodeType != XmlNodeType.Element)
363 {
364 xmlNode = ((!(xmlNode is XmlAttribute xmlAttribute)) ? xmlNode.ParentNode : xmlAttribute.OwnerElement);
365 }
366 XmlElement xmlElement = xmlNode as XmlElement;
367 if (xmlElement != null)
368 {
369 string localName = ((name == null || name.Length == 0) ? _document.strXmlns : name);
370 string strReservedXmlns = _document.strReservedXmlns;
371 do
372 {
373 XmlAttribute attributeNode = xmlElement.GetAttributeNode(localName, strReservedXmlns);
374 if (attributeNode != null)
375 {
376 return attributeNode.Value;
377 }
379 }
380 while (xmlElement != null);
381 }
382 if (name == _document.strXml)
383 {
385 }
386 if (name == _document.strXmlns)
387 {
389 }
390 return string.Empty;
391 }

References System.Xml.DocumentXPathNavigator._document, System.Xml.DocumentXPathNavigator._source, System.Xml.Dictionary, System.Xml.XmlDocument.strReservedXml, System.Xml.XmlDocument.strReservedXmlns, System.Xml.XmlDocument.strXml, and System.Xml.XmlDocument.strXmlns.