dthomso1 / CubeSatSeniorDesign

CubeSatProject
0 stars 0 forks source link

XML parsers #13

Open Jezharsha opened 4 years ago

Jezharsha commented 4 years ago
dthomso1 commented 4 years ago

It would be relatively simple if we wanted to allow the user of our application to edit the xml docs from within (i.e: add errors to the xml files, edit properties, etx). Is this something we want to discuss with the clients? Most of the code is included in the System.Xml package.

dthomso1 commented 4 years ago

Here is a solution using c#, however before this is integrated into the program, there also has to be a XAML solution as well to pull names for the menus if I'm not mistaken. I have found the resources to do so in XAML: https://stackoverflow.com/questions/10065622/how-to-retrieve-xml-attributes-with-xaml. I will add the XAML solution and then add to the full code.

`using System; using System.IO; using System.Xml;

using System; using System.IO; using System.Xml;

public class ParseXMLErrors { public static void Main() { //Create the XmlDocument. XmlDocument Errors = new XmlDocument(); Errors.Load("CubeSatPossibleErrors.xml");

    //Display all the book titles.
    XmlNodeList elemList = doc.GetElementsByTagName("ErrorTitle");
    for (int i = 0; i < elemList.Count; i++)
    {
        Console.WriteLine(elemList[i].InnerXml);
    }
}

}`