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

◆ LookupNamespace()

string System.Xml.XmlNodeReaderNavigator.LookupNamespace ( string prefix)
inline

Definition at line 860 of file XmlNodeReaderNavigator.cs.

861 {
863 {
864 return null;
865 }
866 if (prefix == "xmlns")
867 {
868 return _nameTable.Add("http://www.w3.org/2000/xmlns/");
869 }
870 if (prefix == "xml")
871 {
872 return _nameTable.Add("http://www.w3.org/XML/1998/namespace");
873 }
874 if (prefix == null)
875 {
876 prefix = string.Empty;
877 }
878 string name = ((prefix.Length != 0) ? ("xmlns:" + prefix) : "xmlns");
879 XmlNode xmlNode = _curNode;
880 while (xmlNode != null)
881 {
882 if (xmlNode.NodeType == XmlNodeType.Element)
883 {
884 XmlElement xmlElement = (XmlElement)xmlNode;
885 if (xmlElement.HasAttributes)
886 {
887 XmlAttribute attributeNode = xmlElement.GetAttributeNode(name);
888 if (attributeNode != null)
889 {
890 return attributeNode.Value;
891 }
892 }
893 }
894 else if (xmlNode.NodeType == XmlNodeType.Attribute)
895 {
896 xmlNode = ((XmlAttribute)xmlNode).OwnerElement;
897 continue;
898 }
899 xmlNode = xmlNode.ParentNode;
900 }
901 if (prefix.Length == 0)
902 {
903 return string.Empty;
904 }
905 return null;
906 }
string Add(char[] array, int offset, int length)

References System.Xml.XmlNodeReaderNavigator._bCreatedOnAttribute, System.Xml.XmlNodeReaderNavigator._curNode, System.Xml.XmlNodeReaderNavigator._nameTable, System.Xml.XmlNameTable.Add(), System.Xml.Dictionary, and System.prefix.

Referenced by System.Xml.XmlNodeReader.LookupNamespace(), and System.Xml.XmlNodeReaderNavigator.LookupPrefix().