hi
i have wrote following program its not providing me acurate result which i want and it showing this ( #text) but where it came from i dont know you can run it is running correct but no desired out put can any one help me.....?
<?xml version="1.0" encoding="utf-8" ?>
<hidaya>
<IT>
<SoftwareDelevelopment>
<ASP time="Three Month" at="Jamshoro">ASP.NET, MS SQLSEVER, ADVANCE</ASP>
<PHP time="Four month" at="Jamshoro">Basic php advance php mysql joomla</PHP>
</SoftwareDelevelopment>
<NetworkAddminstrator time="One Month">
MCSE
</NetworkAddminstrator>
<Linux time="One Month">Linux Addminstration</Linux>
</IT>
</hidaya>
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
XmlDocument doc = new XmlDocument();
doc.Load(Server.MapPath("XMLFile.xml"));
foreach (XmlNode node in doc.DocumentElement)
{
if (node.HasChildNodes)
{
Response.Write("Content of" + node.Name + " Node<br/>");
foreach (XmlNode childNodeNodeElement in node)
{
Response.Write(" " + childNodeNodeElement.Name+"<br/>");
if (childNodeNodeElement.HasChildNodes)
{
foreach (XmlNode childNodechildNodeNodeElementElement in childNodeNodeElement)
{
Response.Write(" " + childNodechildNodeNodeElementElement.Name+"<br/>");
if (childNodechildNodeNodeElementElement.NodeType==XmlNodeType.Element)//.HasChildNodes)
{
foreach (XmlNode childNodechildNodeNodeElementChileElement in childNodechildNodeNodeElementElement)
{
Response.Write(" " + childNodechildNodeNodeElementChileElement.InnerText+"<br/>");
}
}
else {
Response.Write(" " + childNodechildNodeNodeElementElement.InnerText + "<br/>");
}
// Response.Write(" " + childNodechildNodeNodeElementElement.InnerText);
}
}else{
Response.Write(" " + childNodeNodeElement.InnerText);
}
}
}
else {
Response.Write("Value is "+node.InnerText);
}
}