Question: Using C# Create a class that will extract and print the following information from the OrderSample.xml document below: -The order detail information -All the customer

Using C# Create a class that will extract and print the following information from the OrderSample.xml document below:

-The order detail information

-All the customer information including shipping and billing address

OrderSample.xml File below

1 1/1/2020 12.99 i 1 11 2 9.99 2 1 12 5 20.00 1 Jane Doe 1 2 jane@doe.com 1 12 main st apt 111 DAvie FL 33314 2 PO Box 123456 Davie FL 33329

This is what I have so far but I'm not sure how to get it to work. I need to get it to print to the console

public class Question3 { public void extractorXmlDocument() { string xmlString = ""; XmlDocument document = new XmlDocument(); document.Load("C:\\VS\\OrderSample.xml");

var title = document.SelectSingleNode("/OrderDetail"); Console.WriteLine(title.InnerText);

var authors = document.SelectNodes("/OrdeDetail"); foreach (XmlNode author in authors)

{ var firstname = title.SelectSingleNode("firstname");

Console.WriteLine(firstname.InnerText); }

} } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!