I'm not sure if this is the right forum to ask this.
I make a XML code snippet to simplify my own problem.
-- code snippet start ------
sXml =
"<Depart>
<employee id='1' name='abc' amount='10' />
<employee id='1' name='abc' amount='20' />
<employee id='1' name='abc' amount='30' />
<employee id='2' name='fgh' amount='5' />
<employee id='2' name='fgh' amount='100' />
<employee id='3' name='xyz' amount='10' />
</Depart>"
XmlDocument doc = new XmlDocument();
doc.LoadXml(sXml);
string xPathQuery = "???????";
XmlNodeList nodes = doc.SelectNodes(xPathQuery);
----
I made XmlDocument from this XML string.
In first, I want to get employee list.
abc, fgh, xyz
Finally, the job is to get the following result.
Name # Total
abc 3 60
fgh 2 105
xyz 1 10
Can I do this jobs by XPath? Or Do I have to use others?
If so, what ?
Thanks,
jongmin