Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using XML convert this file to a class so when you run the class it should print out an identical . I got the beginning

Using XML convert this file to a class so when you run the class it should print out an identical . I got the beginning started but I'm unsure how to finish it.

public void Generate() { XmlDocument doc = new XmlDocument();

XmlDeclaration xmlDeclaration = doc.CreateXmlDeclaration("1.0", "UTF-8", null);

XmlElement root = doc.DocumentElement; doc.InsertBefore(xmlDeclaration, root);

XmlNode Order = doc.CreateElement("Order");

XmlNode title = doc.CreateElement("OrderId"); XmlText titleText = doc.CreateTextNode("1"); title.AppendChild(titleText);

XmlNode OrderDate = doc.CreateElement("OrderDate"); XmlText OrderDateText = doc.CreateTextNode("1/1/2020"); OrderDate.AppendChild(OrderDateText);

XmlNode ShippingPrice = doc.CreateElement("ShippingPrice"); XmlText ShippingPriceText = doc.CreateTextNode("12.99"); ShippingPrice.AppendChild(ShippingPriceText);

doc.AppendChild(Order);

doc.Save("C:/VS//GetOrder.xml");

The file below must be turned into a class so when you run the class this file below is printed

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

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 Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

What is focal length? Explain with a diagram and give an example.

Answered: 1 week ago

Question

What is physics and how does it apply in daily life?

Answered: 1 week ago