xml file
this is my xml file:
<Apoeni>
<valuta category ="191">
<value>25value>
<name>25name>
valuta>
<valuta category ="191">
<value>5value>
<name>5name>
valuta>
<valuta category ="191">
<value>2value>
<name>2name>
valuta>
I would like to read all the values exept value "2" for specific category ? How to do that?
HrvojePosted Sep 11, 2009, 7:13 AM
Lakhan PalPosted Sep 11, 2009, 5:20 AM
Check this function:
private void ReadXMLData()
{
XmlDocument xDoc=new XmlDocument();
xDoc.LoadXml("
System.Text.StringBuilder strData = new System.Text.StringBuilder("");
XmlNodeList ndList =xDoc.GetElementsByTagName("valuta");
for(Int16 iCount=0; iCount
XmlNodeList ndValue = ndList.Item(iCount).ChildNodes;
for(Int16 jCount=0; jCount
if (Convert.ToInt32(ndValue.Item(jCount).InnerText) != 2 && Convert.ToInt32(ndList[iCount].Attributes["category"].Value) == 191)
{
strData.Append(ndValue.Item(jCount).InnerText + "
");
}
}
}
Response.Write(strData.ToString());
}