Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how can i access the rank data in .net framework

in this case i want to access the value 1 of rank

XML
<clinical_study rank="1">

</clinical_study>


What I have tried:

i have tried applying xmlnodes but couldnt find a way to retain the data..
Posted
Updated 13-Apr-16 19:42pm
Comments
Sergey Alexandrovich Kryukov 14-Apr-16 1:19am    
Not clear. What would you mean by "retain data". It's nothing but XML parsing, use any parser of your choice.
—SA

1 solution

Rank is the attribute of node clinical_study, you can either use XmlDocument class or XMLReader to read xml and get its attribute value
see below snippet
C#
var doc = new XmlDocument();
//doc.Load(path);
string xml = "<root><clinical_study rank="1"></clinical_study></root>"
doc.LoadXml(xml);
string szRank = doc.getElementByTagName("clinical_study")[0].Attributes["rank"].value;

hope it helps
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900