Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

get attribute value of xml element c#

string name;
XmlDocument xml = new XmlDocument();
xml.Load("theFile.xml"); 
// Or any other method to load your xml data in the XmlDocument.
// For example if your xml data are in a string, use the LoadXml method.
XmlElement elt = xml.SelectSingleNode("//SubMenu[@id='STE']") as XmlElement;
if(elt!=null)
{
  name=elt.GetAttribute("name");  
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: flip a character in unity 
Csharp :: npm install --save vue-route@n 
Csharp :: how to check datagridview cell is null or empty 
Csharp :: c# int array length 
Csharp :: index of item in list C# 
Csharp :: unity call function on animation onstateexit 
Csharp :: unity action example 
Csharp :: Configure Automapper 
Csharp :: unity string lowercase 
Csharp :: c# get country code 
Csharp :: check if string variable contains only letters c# 
Csharp :: unity health bar 
Csharp :: unity call function from another script 
Csharp :: c# append array 
Csharp :: parsing string to int c# 
Csharp :: c# list declaration 
Csharp :: datetimeoffset to datetime c# 
Csharp :: datatable linq where clause c# 
Csharp :: how to remove white spaces from string in c# 
Csharp :: NameValueCollection 
Csharp :: c# convert string array to int array 
Csharp :: c# get all namespaces in assembly 
Csharp :: how to deserialize string array in c# 
Csharp :: c# run batch file 
Csharp :: increase value in dictionary against a key in c# 
Csharp :: c# struct 
Csharp :: c# mongodb get all documents 
Csharp :: comments in c# 
Csharp :: c# html to pdf 
Csharp :: c# code to read txt file line by line and split 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =