C
C# newbie
Hello everybody,
in a code as this:
foreach (XmlNode xnode in node.SelectSingleNode(txtPattern.Text,nsmgr))
{
switch (xnode.NodeType){
case XmlNodeType.Element:
MessageBox.Show("This node is an ement");
break;
case XmlNodeType.Text:
MessageBox.Show("this node has type of text");
break;
}
for an xml file as :
<AAA>
<BCC>
<BBB/>
<data>'Text goes here'</data>
<BBB/>
</BCC>
</AAA>
the case only shows that all nodes types are Element! but there are some
text too. Does anybody know how I would be able to find out an element's
type ?
Thanks
Newbie
in a code as this:
foreach (XmlNode xnode in node.SelectSingleNode(txtPattern.Text,nsmgr))
{
switch (xnode.NodeType){
case XmlNodeType.Element:
MessageBox.Show("This node is an ement");
break;
case XmlNodeType.Text:
MessageBox.Show("this node has type of text");
break;
}
for an xml file as :
<AAA>
<BCC>
<BBB/>
<data>'Text goes here'</data>
<BBB/>
</BCC>
</AAA>
the case only shows that all nodes types are Element! but there are some
text too. Does anybody know how I would be able to find out an element's
type ?
Thanks
Newbie