S
Sharon
Hi guys
I don't understand what I am doing wrong
I wrote this code, in order to manipulate some Xml data, I have problem with
level 4 (properties section):
//CODE -----------------------------------------------------------------------------------------------------------------------------------------
XmlDocument xmlDoc = new XmlDocument();
XmlNodeList items = xmlDoc.GetElementsByTagName("item");
IEnumerator iEnum = items.GetEnumerator();
while(iEnum.MoveNext())
{
XmlNode itemNode = iEnum.Current ;
XmlElement name = itemNode.SelectSingleNode("name");
XmlNodeList properties =
itemNode.SelectNodes("Properties");
for(int i=0;i<properties.Count;i++)
MessageBox.Show(properties);
}
//CODE -----------------------------------------------------------------------------------------------------------------------------------------
for extracting some data on this XML file :
//XML -----------------------------------------------------------------------------------------------------------------------------------------
<items>
<item type="car">
<name ="Volvo">
<Properties>
<manufacturer="F16" />
<engine="1300" />
<color="White"/>
</properties>
</item>
</items>
//XML -----------------------------------------------------------------------------------------------------------------------------------------
The problem is that I'm getting from the for loop message : "F161300White"
Instead of 3 message boxes: "F16" "1300" "White"
please advise .
Thank you
Sharon
I don't understand what I am doing wrong
I wrote this code, in order to manipulate some Xml data, I have problem with
level 4 (properties section):
//CODE -----------------------------------------------------------------------------------------------------------------------------------------
XmlDocument xmlDoc = new XmlDocument();
XmlNodeList items = xmlDoc.GetElementsByTagName("item");
IEnumerator iEnum = items.GetEnumerator();
while(iEnum.MoveNext())
{
XmlNode itemNode = iEnum.Current ;
XmlElement name = itemNode.SelectSingleNode("name");
XmlNodeList properties =
itemNode.SelectNodes("Properties");
for(int i=0;i<properties.Count;i++)
MessageBox.Show(properties);
}
//CODE -----------------------------------------------------------------------------------------------------------------------------------------
for extracting some data on this XML file :
//XML -----------------------------------------------------------------------------------------------------------------------------------------
<items>
<item type="car">
<name ="Volvo">
<Properties>
<manufacturer="F16" />
<engine="1300" />
<color="White"/>
</properties>
</item>
</items>
//XML -----------------------------------------------------------------------------------------------------------------------------------------
The problem is that I'm getting from the for loop message : "F161300White"
Instead of 3 message boxes: "F16" "1300" "White"
please advise .
Thank you
Sharon