hello and thanks for reply. I dont' use c++ but C#. I tried with this:
XmlNode n = Xml_doc.FirstChild;
while (n != null) {
XmlElement e = (XmlElement)n; //conversion
if (e != null) {
Console.WriteLine(e.Name);
}
if (n.NextSibling == null) n = n.FirstChild; //1
else n = n.NextSibling; //2
}
XmlNode n = Xml_doc.FirstChild;
while (n != null) {
XmlElement e = (XmlElement)n; //conversion
if (e != null) {
Console.WriteLine(e.Name);
}
if (n.NextSibling == null) n = n.FirstChild; //1
else n = n.NextSibling; //2
}
To copy to clipboard, switch view to plain text mode
I isert //1 and //2 because if there isn't brothers Nextsibling return me a null and I'll exit the loop; this seem works but but when I meet a nodeText, conversion generate an exception and however nodeText.nextSibling gets me null;
ANy hints to improve it, please?
Bookmarks