Question: 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

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!