<commit_before>using System;
using System.Collections.Generic;
using System.Xml;
using System.Linq;
using System.Xml.Linq;
using openvassharp;
using System.Threading;

namespace Example
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			using (OpenVASSession session = new OpenVASSession ("admin", "password", "192.168.1.99")) {
				using (OpenVASManager manager = new OpenVASManager (session)) {

					XDocument target = manager.CreateSimpleTarget ("192.168.1.0/24", Guid.NewGuid().ToString());
					string targetID = target.Root.Attribute ("id").Value;

					XDocument configs = manager.GetScanConfigurations ();

					string discoveryConfigID = string.Empty;
					foreach (XElement node in configs.Descendants(XName.Get("name"))) {
						if (node.Value == "Discovery")
							discoveryConfigID = node.Parent.Attribute ("id").Value;
					}

					XDocument task = manager.CreateSimpleTask (Guid.NewGuid ().ToString (), string.Empty, new Guid(discoveryConfigID), new Guid(targetID));

					Guid taskID = new Guid (task.Root.Attribute ("id").Value);

					manager.StartTask (taskID);

					XDocument status = manager.GetTasks (taskID);

					while (status.Descendants("status").First().Value != "Done") {
						Thread.Sleep (500);
						Console.WriteLine (status.Descendants (XName.Get("progress")).First ().Value);
						status = manager.GetTasks(taskID);
					}

					XDocument results = manager.GetTaskResults (taskID);

					Console.WriteLine (results.ToString ());
				}
			}
		}
	}
}
<commit_msg>Ensure we only get the text from the progress element, and not of any sub-elements.<commit_after>using System;
using System.Collections.Generic;
using System.Xml;
using System.Linq;
using System.Xml.Linq;
using openvassharp;
using System.Threading;

namespace Example
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			using (OpenVASSession session = new OpenVASSession ("admin", "password", "192.168.1.99")) {
				using (OpenVASManager manager = new OpenVASManager (session)) {

					XDocument target = manager.CreateSimpleTarget ("192.168.1.0/24", Guid.NewGuid().ToString());
					string targetID = target.Root.Attribute ("id").Value;

					XDocument configs = manager.GetScanConfigurations ();

					string discoveryConfigID = string.Empty;
					foreach (XElement node in configs.Descendants(XName.Get("name"))) {
						if (node.Value == "Discovery")
							discoveryConfigID = node.Parent.Attribute ("id").Value;
					}

					XDocument task = manager.CreateSimpleTask (Guid.NewGuid ().ToString (), string.Empty, new Guid(discoveryConfigID), new Guid(targetID));

					Guid taskID = new Guid (task.Root.Attribute ("id").Value);

					manager.StartTask (taskID);

					XDocument status = manager.GetTasks (taskID);

					while (status.Descendants("status").First().Value != "Done") {
						Thread.Sleep (500);
						Console.WriteLine (status.Descendants (XName.Get("progress")).First ().Nodes().OfType<XText>().First().Value);
						status = manager.GetTasks(taskID);
					}

					XDocument results = manager.GetTaskResults (taskID);

					Console.WriteLine (results.ToString ());
				}
			}
		}
	}
}

{'fraction_non_alphanumeric': 0.13676844783715011, 'fraction_numerical': 0.013994910941475827, 'mean_word_length': 3.7796352583586628, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6562136', 'n_tokens_mistral': 1170, 'n_tokens_neox': 916, 'n_words': 220}