How do I get the total number of nodes in an xml document?
i've tried
dim myxmlnode as xml.xmlnode
msgbox myxmlnode.childnodes.count
it doesn't work, any ideas? thank you.
Printable View
How do I get the total number of nodes in an xml document?
i've tried
dim myxmlnode as xml.xmlnode
msgbox myxmlnode.childnodes.count
it doesn't work, any ideas? thank you.
VB Code:
Dim xdoc As New XmlDocument xdoc.Load("..\data.xml") Dim xnods As XmlNodeList = xdoc.SelectNodes("//*") MsgBox(xnods.Count)
Although remember that the root counts as well as any parent nodes.