I'm admittedly a complete newb to programming with XML. I'm working with the attached document (changed the extension to .ZIP for uploading) but can't get anything to work for XPATH. Can I get some help here? I'd like for the program to list each node's name instead of going to the ZERO STUPID message box line. Thanks guys.
Code:
Dim xmlDoc = New XmlDocument xmlDoc.Load(txtFilename.Text)
'NO IDEA WHAT I'M DOING HERE!
'Dim nsmXMLMgr As XmlNamespaceManager = New XmlNamespaceManager(xmlDoc.NameTable)
'nsmXMLMgr.AddNamespace("", "urn:crystal-reports:schemas:report-detail")
'nsmXMLMgr.AddNamespace("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance")
'nsmXMLMgr.AddNamespace("xsi:schemaLocation", "urn:crystal-reports:schemas:report-detail http://www.businessobjects.com/products/xml/CR2008Schema.xsd")
Dim ndeNode As XmlNode, ndeList As XmlNodeList
Dim ndeRoot As XmlElement = xmlDoc.DocumentElement
Dim intFoundNode As Integer = 0
ndeList = ndeRoot.SelectNodes("//CrystalReport") ', nsmXMLMgr)
If ndeList.Count = 0 Then
Call MsgBox("ZERO STUPID.")
Else
For Each ndeNode In ndeList
Debug.Print(ndeNode.Name)
Next
End If
System.Diagnostics.Debugger.Break()