Hi Saurabh,
I hope the following code should help you.
XmlDocument _Document = new XmlDocument();
XmlNodeList properties;
_Document.Load (XmlFileName);
XmlNodeList properties = _Document["Design"].ChildNodes;
foreach (XmlNode property in properties)
{
if(property.HasChildNodes)
{
XmlNodeList childNodes = property.ChildNodes;
foreach(XmlNode childNode in childNodes)
{
MessageBox.Show(childNode.Attributes["FILE"].Value); // You can
show file name.
}
}
}
Thanks,
Muralidhar GVN
Saurabh wrote:
Thanks Daniel, i learned a new way to access XML.
The problem is that the xml has to look like:
<ROOT>
<FILE NAME="filename"></FILE>
</ROOT>
beacuse the xml is generated by a recursive function which scans the
file system (DirectoryInfo ans FileInfo class) and generate a xml. The
exact xxml format is:
<ROOT>
<DIRECTORY>
<FILE NAME="filename">CDATA contains filestream</FILE>
<FILE NAME="filename">CDATA contains filestream</FILE>
</DIRECTORY>
<DIRECTORY>
<FILE NAME="filename">CDATA contains filestream</FILE>
<FILE NAME="filename">CDATA contains filestream</FILE>
</DIRECTORY>
</ROOT>
you never know if the filename can be same with different extension.
just to be precautious i have made the file tag with filename as
attribute.