[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 269
  • Last Modified:

XML parsing - get elements inside a specific path - vb.net

Hi there,
I would like to read the elements in "\SETTINGS\OSRS" using XmlDocument with vb.net...
How read ONLY elements inside "OSRS"?

<SETTINGS>
      <OSRS>
<Index>0</Index>
<ObjectName>%systemroot%</ObjectName>
<Permissions>ReadAndExecute</Permissions>
<Groups>Authenticated Users, Users</Groups>
<Index>1</Index>
<ObjectName>%systemroot%\system32</ObjectName>
<Permissions>ReadAndExecute</Permissions>
<Groups>Authenticated Users, Users</Groups>
<Index>1</Index>
<ObjectName>%systemroot%\system32</ObjectName>
<Permissions>ListDirectory, ReadAndExecute</Permissions>
<Groups>Authenticated Users, Users</Groups>
    </OSRS>
</SETTINGS>
Thanks in advance!
0
nahumba
Asked:
nahumba
1 Solution
 
Wayne Taylor (webtubbs)Commented:
Hi nahumba,

Like this....

        Dim xmlDoc As New Xml.XmlDocument
        xmlDoc.Load("C:\YourFile.xml")
        For Each nd As Xml.XmlNode In xmlDoc.DocumentElement.SelectNodes("OSRS")(0)
            MsgBox(nd.Name & " = " & nd.InnerText)
        Next

Regards,

Wayne
0
 
nahumbaAuthor Commented:
Thank you so much Wayne! Works great!

nahumba
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now