Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions