Click here to Skip to main content
15,913,685 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
im want to read the below xml file having same element name and differet attributes i want the values like [Depositor 1,prakash,Cheque] thanks in advance

HTML
<subform name="sfDepositorDetails" presence="visible">
                  <instanceManager name="_sfDepositor" />
                  <subform name="sfDepositor">
                    <field name="lblKeyDepositor">
                      <value>
                        <text>Depositor 1</text>
                      </value>
                    </field>
                    <field name="txtDepositorName">
                      <value>
                        <text>prakash</text>
                      </value>
                    </field>
                    <field name="ddHSBCFunds">
                      <value override="1">
                        <text>Cheque</text>
                      </value>
                    </field>
                  </subform>
Posted

Please refer:
Parse XML Documents by XMLDocument and XDocument[^]

Hope it helps!
 
Share this answer
 
StringBuilder str = new StringBuilder();
XmlDocument Doc = new XmlDocument();
string str1 = File.ReadAllText("XMLFile1.xml");
Doc.Load("XMLFile1.xml");

foreach (XmlNode node in Doc.SelectNodes("//text"))
{
str.Append(node.InnerText);
str.Append(",");
}
 
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