i have one xml file which have below data, i need to give Name attribute and need to get Heirarchy attribute value.
please give me c# code for this(linq to xml or other approach)
for example:
input: LoginUserName
output: LogInWindow,textBox_UserName
input: PatientCreateName
output: PatienceLogInWindow,textBox_UserName
<Login Name="LogInWindow" Heirarchy="Login">
<UserName Name="LoginUserName" Heirarchy="LogInWindow,textBox_UserName" Type="Edit"/>
<Password Name="LoginPassword" Heirarchy="LogInWindow,textBox_Password" Type="Edit"/>
<Button Name="LoginButton" Heirarchy="LogInWindow,OKButton" Type="Edit"/>
</Login>
<PatientCreate Name="Sample1" Heirarchy="LogInWindow">
<UserName Name="PatientCreateName" Heirarchy="PatienceLogInWindow,textBox_UserName" Type="Edit"/>
<Password Name="PatientLoginUserName" Heirarchy="LogInWindow,textBox_UserName" Type="Edit"/>
<Button Name="PatientLoginUserButton" Heirarchy="LogInWindow,textBox_UserName" Type="Edit"/>
</PatientCreate>
</UIW>