<?xml version="1.0" ?> <Logs xmlns="http://www.mywebsite.com/schemas/compliance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Version="2.0"> <Log> <Exceptions> <Exception> <GroupName>Labor Time</GroupName> </Exception> <Exception> <GroupName>Parts Usage</GroupName> </Exception> </Exceptions> </Log> <Log> <Exceptions> <Exception> <GroupName>Labor Time 2</GroupName> </Exception> <Exception> <GroupName>Parts Usage 2</GroupName> </Exception> </Exceptions> </Log> </Logs>I used this code to get the node list from my XML class:
loXml.GetXMLNodeList("//ns:Logs/ns:Log/ns:Exceptions/ns:Exception")
Then, I can scan it like this:For Each loNodeRecord In loXml.oXmlNodeList lnCounter = lnCounter + 1 loStringBuilder.Append("<TR>") loStringBuilder.Append("<TD ALIGN=RIGHT>" + lnCounter.ToString + ".") For Each loNodeField In loNodeRecord.ChildNodes Select Case loNodeField.Name Case "GroupName" loStringBuilder.Append("<TD>" + Trim(loNodeField.InnerText)) End Select Next NextHowever, doing it like this means that I will end up with four records because I have those branches that match in the first hierarchy and another two in the second hierarchy. The client wants that I only get the records from the first one. How can I adjust to only get the records from the first one? Is there a way to identify an identifier of 1 in the loXml.GetXMLNodeList() command to let the class know that I want the first occurence only? I think I saw something like that before where we can specify and identifier for such a need.