Home > DeveloperSection > Forums > Problems accessing certain node reading xml with C#
Jayden Bell
Jayden Bell

Total Post:105

Posted on    August-14-2014 5:16 AM

 C# C# 

 1 Reply(s)
 884  View(s)
Rate this:

My XML looks like this:

<?xml version="1.0" encoding="UTF-8"?>



    <add key="LoggerId" value="8a2ff9ef-d144-4dcb-86d8-6ccaf44def20">


    <add key="FederationId" value="00000000-0000-0000-0000-000000000000" />



My code:

XmlDocument xml = new XmlDocument();


XmlNodeList xnList = xml.SelectNodes("/configuration/something.logger");

I am trying to get the Guid (or value..) of value.

In the end i want to get the string "8a2ff9ef-d144-4dcb-86d8-6ccaf44def20"

Thanks !

Pravesh Singh

Total Post:411

Posted on    August-14-2014 6:56 AM

Hi Jayden, 
Try this:

XmlNodeList xnList = xml.SelectNodes("/configuration/something.logger/add/@value");

Don't want to miss updates? Please click the below button!

Follow MindStick