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

◆ GetNamespace() [1/2]

string System.Xml.XPathNodePointer.GetNamespace ( string name)
inlinepackage

Definition at line 1241 of file XPathNodePointer.cs.

1242 {
1243 switch (name)
1244 {
1245 case "xml":
1246 return "http://www.w3.org/XML/1998/namespace";
1247 case "xmlns":
1248 return "http://www.w3.org/2000/xmlns/";
1249 default:
1250 if (name.Length == 0)
1251 {
1252 name = "xmlns";
1253 }
1254 break;
1255 case null:
1256 break;
1257 }
1258 RealFoliate();
1259 XmlNode xmlNode = _node;
1260 XmlNodeType nodeType = xmlNode.NodeType;
1261 string text = null;
1262 while (xmlNode != null)
1263 {
1264 while (xmlNode != null && (nodeType = xmlNode.NodeType) != XmlNodeType.Element)
1265 {
1266 xmlNode = ((nodeType != XmlNodeType.Attribute) ? xmlNode.ParentNode : ((XmlAttribute)xmlNode).OwnerElement);
1267 }
1268 if (xmlNode != null)
1269 {
1270 text = GetNamespace((XmlBoundElement)xmlNode, name);
1271 if (text != null)
1272 {
1273 return text;
1274 }
1275 xmlNode = xmlNode.ParentNode;
1276 }
1277 }
1278 return string.Empty;
1279 }
string GetNamespace(XmlBoundElement be, string name)
XmlNodeType NodeType
Definition XmlNode.cs:73

References System.Xml.XmlNode.NodeType, System.Xml.XmlElement.ParentNode, System.Xml.XmlNode.ParentNode, and System.text.