XML select node, then select case not working
Posted on 2006-10-20
I am trying to run a sepcific sub based on a node type within a chosen XML file. I have a select case that runs a specific subroutine based on the node string.
Here is my code;
Private Sub OpenXML(ByVal SourceFileName As String) ' Open XML document and run query based on XML node <Type></Type>
Dim XmlDoc As New XmlDocument
XmlDoc.Load(SourceFileName) 'SourceFilename will be something like c:\uploads\anXMLfile.xml
Dim currentNode As XmlNode
Dim currentNodes As XmlNodeList = XmlDoc.SelectNodes("//Type/Type") '<--- Here I am trying to specify the node, which is simply <Type></Type>
Dim currentArray As ArrayList = NodesToArrayList(currentNodes)
For Each currentNode In currentNodes '<--- Here I run a Select Case based on the string within the node, ie. "Hardware", "Checked" and "Unchecked"
Select Case currentNode.ToString
None of the select case statements are giving me output to a messagebox, so I dont think it is working.
I have also checked the Type node for all three xml files, and they all read correctly.