S
Sylesh Nair
hello ,
I have a problem in retreiving the inner Xml from an XML File . The File is
pasted below and the method I use is also listed below .
I want to list out the values Sylesh1,Sylesh2,sylesh3........ sylesh9 to an
arrayList .
The Method I use is
XmlDocument _Document = new XmlDocument ();
_Document.Load (FileName);
XmlElement _Root = _Document.DocumentElement ;
XmlNodeList _NodeList = _Document.GetElementsByTagName
("configuration/userNames/sylesh/add/listGridCustomizations/myListGrid");
if (_NodeList.Count > 0)
{
foreach (XmlNode _Node in _NodeList)
{
List.Add(_Node.Attributes.GetNamedItem ("value").InnerText);
}
}
Any help ? suggestions ?
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userNames">
<sectionGroup name="sylesh">
<sectionGroup name="listGridCustomizations">
<section name="myListGrid"
type="System.Configuration.NameValueSectionHandler,System,Version=1.0.5000.0,
Culture=neutral,PublicKeyToken=b77a5c561934e089"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<userNames>
<sylesh>
<add key="IsCustomized" value="false" />
<listGridCustomizations>
<myListGrid>
<add key="Column0" value="Sylesh0" />
<add key="Column1" value="Sylesh1" />
<add key="Column2" value="Sylesh2" />
<add key="Column3" value="Sylesh3" />
<add key="Column4" value="Sylesh4" />
<add key="Column5" value="Sylesh5" />
<add key="Column6" value="Sylesh6" />
<add key="Column7" value="Sylesh7" />
<add key="Column8" value="Sylesh8" />
<add key="Column9" value="Sylesh9" />
</myListGrid>
</listGridCustomizations>
<listGridCustomizations>
<wrwerwer>
<add key="Column0" value="Sylesh0" />
<add key="Column1" value="Sylesh1" />
<add key="Column2" value="Sylesh2" />
<add key="Column3" value="Sylesh3" />
<add key="Column4" value="Sylesh4" />
<add key="Column5" value="Sylesh5" />
<add key="Column6" value="Sylesh6" />
<add key="Column7" value="Sylesh7" />
<add key="Column8" value="Sylesh8" />
<add key="Column9" value="Sylesh9" />
</wrwerwer>
</listGridCustomizations>
</sylesh>
</userNames>
</configuration>
I have a problem in retreiving the inner Xml from an XML File . The File is
pasted below and the method I use is also listed below .
I want to list out the values Sylesh1,Sylesh2,sylesh3........ sylesh9 to an
arrayList .
The Method I use is
XmlDocument _Document = new XmlDocument ();
_Document.Load (FileName);
XmlElement _Root = _Document.DocumentElement ;
XmlNodeList _NodeList = _Document.GetElementsByTagName
("configuration/userNames/sylesh/add/listGridCustomizations/myListGrid");
if (_NodeList.Count > 0)
{
foreach (XmlNode _Node in _NodeList)
{
List.Add(_Node.Attributes.GetNamedItem ("value").InnerText);
}
}
Any help ? suggestions ?
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userNames">
<sectionGroup name="sylesh">
<sectionGroup name="listGridCustomizations">
<section name="myListGrid"
type="System.Configuration.NameValueSectionHandler,System,Version=1.0.5000.0,
Culture=neutral,PublicKeyToken=b77a5c561934e089"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<userNames>
<sylesh>
<add key="IsCustomized" value="false" />
<listGridCustomizations>
<myListGrid>
<add key="Column0" value="Sylesh0" />
<add key="Column1" value="Sylesh1" />
<add key="Column2" value="Sylesh2" />
<add key="Column3" value="Sylesh3" />
<add key="Column4" value="Sylesh4" />
<add key="Column5" value="Sylesh5" />
<add key="Column6" value="Sylesh6" />
<add key="Column7" value="Sylesh7" />
<add key="Column8" value="Sylesh8" />
<add key="Column9" value="Sylesh9" />
</myListGrid>
</listGridCustomizations>
<listGridCustomizations>
<wrwerwer>
<add key="Column0" value="Sylesh0" />
<add key="Column1" value="Sylesh1" />
<add key="Column2" value="Sylesh2" />
<add key="Column3" value="Sylesh3" />
<add key="Column4" value="Sylesh4" />
<add key="Column5" value="Sylesh5" />
<add key="Column6" value="Sylesh6" />
<add key="Column7" value="Sylesh7" />
<add key="Column8" value="Sylesh8" />
<add key="Column9" value="Sylesh9" />
</wrwerwer>
</listGridCustomizations>
</sylesh>
</userNames>
</configuration>