Question

In: Computer Science

1. Create an xml documents called company.xmlcontaining two sections employees and invoices with the following specifications:...


1. Create an xml documents called company.xmlcontaining two sections employees and invoices with the following specifications:

A.

Employee
Name
o Last name
o First name
Address
Hire Date

B.

Invoice
Order (Should have an order number attribute)
o Name (of the customer)
o Address (of the customer)
o Total price (of the order)
o Date (of the order)
Shipping info
o Name (of the company) - Use either of the following:
Fed Ex
UPS
o Total price (for shipping)
o Date (Ship date)
Description
o (This section should describe the ordered product. Use <product> whenever the product is mentioned.)

Assume that in the first section (employees) you have chosen tags name, address, date to define the elements employee name, employee address and hire date correspondingly, while in the second section (invoices) you have chosen tags name, address, date to define the elements name of the customer, address of the customer, and date of the ordercorrespondingly. When you create your xml file make sure that one set of tags will not conflict with another (see namespaces in my notes). For example, under the above assumption employees and invoices sectionswill have tags called name, address, date each referring to different types of data depending on the context (e.g. employee name and address vs customer name and address , etc. ). Make sure the documents is well-formed and that your element names follow the specified naming convention in my notes.   

Hint. Use namespaces to resolve naming conflicts.

What to turn in: Submit via Canvas an xml file satisfying the specifications of this lab. The grading will reflect thecorrectness of your markup. Check your XML documentwith your browser before turning it in.

Solutions

Expert Solution

<?xml version = "1.0" encoding = "UTF-8"?>

<Company>

<Emp:Employees xmlns:Emp="http://somecompany.com/employees_info">

<Emp:Employee>

<Emp:Name>

<Emp:LastName>Wuckert</Emp:LastName>

<Emp:FirstName>Jamarcus</Emp:FirstName>

</Emp:Name>

<Emp:Address>8447 Kailee Drive, North Johann, DE 54450-9064</Emp:Address>

<Emp:Date>2014-4-5</Emp:Date>

</Emp:Employee>

<Emp:Employee>

<Emp:Name>

<Emp:LastName>Leuschke</Emp:LastName>

<Emp:FirstName>Albina</Emp:FirstName>

</Emp:Name>

<Emp:Address>878 Schowalter Lights, Stammmouth, MA 83049-8313</Emp:Address>

<Emp:HireDate>2005-3-31</Emp:HireDate>

</Emp:Employee>

</Emp:Employees>

<Invoices>

<Invoice>

<Ord:Order OrderNo="112" xmlns:Ord="http://somecompany.com/order_info">

<Ord:Name>Mr. Hubert White</Ord:Name>

<Ord:Address>3976 Macejkovic Isle, Tierramouth, ID 16031</Ord:Address>

<Ord:TotalPrice>321</Ord:TotalPrice>

<Ord:Date>2018-11-8</Ord:Date>

</Ord:Order>

<Ship:ShippingInfo xmlns:Ship="http://somecompany.com/shippping_info">

<Ship:Name>UPS</Ship:Name>

<Ship:TotalPrice>321</Ship:TotalPrice>

<Ship:Date>2018-11-11</Ship:Date>

</Ship:ShippingInfo>

<Description>

<Product>

Product 1 Info

</Product>

<Product>

Product 2 Info

</Product>

</Description>

</Invoice>

<Invoice>

<Ord:Order OrderNo="123" xmlns:Ord="http://somecompany.com/order_info">

<Ord:Name>Juana Kris</Ord:Name>

<Ord:Address>3576 Grimes Track, Danielhaven, IL 09307-3897</Ord:Address>

<Ord:TotalPrice>999</Ord:TotalPrice>

<Ord:Date>2019-1-10</Ord:Date>

</Ord:Order>

<Ship:ShippingInfo xmlns:Ship="http://somecompany.com/shippping_info">

<Ship:Name>Fed Ex</Ship:Name>

<Ship:TotalPrice>999</Ship:TotalPrice>

<Ship:Date>2019-1-15</Ship:Date>

</Ship:ShippingInfo>

<Description>

<Product>

Product 1 Info

</Product>

</Description>

</Invoice>

</Invoices>

</Company>


Related Solutions

1. The following XML document describes some employees of a company. <?xml version="1.0" encoding="UTF-8"?> <company> <person...
1. The following XML document describes some employees of a company. <?xml version="1.0" encoding="UTF-8"?> <company> <person age="25" id="p29432" manager="p48293"> <ssn>123456789</ssn> <name> John Davis</name> <office>B432</office> <phone>1234</phone> </person> <person age="27" id="p29333" manager="p48222"> <ssn>987654321</ssn> <name>Jim Handler</name> <office>B123</office> </person> <person age=55 id="p29432" manager="p48221"> <ssn>123456789</ssn> <name> Christo Dichev</name> <office>A4210</office> <phone>2477</phone> </person> <person age="57" id="p29333" manager="p4832"> <ssn>987654321</ssn> <name>Elva Jones</name> <office>A4211</office> </person> </company> 1. Check if the XML document is well-formed. If it is not, change it so that it becomes wellformed, making as little changes as...
3.1. Create an XML schema to validate the following XML file. <?xml version="1.0" encoding="utf-8"?> <root> <whats>Everything</whats>...
3.1. Create an XML schema to validate the following XML file. <?xml version="1.0" encoding="utf-8"?> <root> <whats>Everything</whats> <up>Is</up> <doc>Fine</doc> </root> Schema starter: <xsd:schema xmlns:xsd=""> <xsd:element name="root" type="rootType" /> <xsd:complexType name="rootType">     <xsd:sequence>       <xsd:element name="" type="" minOccurs="1" />       <xsd:element name="” type="" minOccurs="1" />       <xsd:element name="" type="" minOccurs="1" />     </xsd:sequence> </xsd:complexType> </xsd:schema> 3.2. Use your schema to validate the XML file.                     3.2.1. You can use Visual Studio or online utilities to apply the schema to the XML file....
Name: __________________________________________ Specifications: Create a class called WordMaker that is passed characters one at a time...
Name: __________________________________________ Specifications: Create a class called WordMaker that is passed characters one at a time and assembles them into words. As long as the characters passed to it are letters, it builds a word by placing each character on the end of a string. When a character that is not part of a word (i.e., is not a letter) is encountered, the class signals that the word is complete, and makes a string containing the word available to its...
c# Create a console application that protects an XML file, such as the following example. Note...
c# Create a console application that protects an XML file, such as the following example. Note that the customer's credit card number and password are currently stored in clear text. The credit card must be encrypted so that it can be decrypted and used later, and the password must be salted and hashed: <?xml version="1.0" encoding="utf-8" ?> <customers> <customer> <name>Bob Smith</name> <creditcard>1234-5678-9012-3456</creditcard> <password>Pa$$w0rd</password> </customer> </customers>
JAVA PROBLEM Part 1: Create a Car class in accordance with the following specifications. I will...
JAVA PROBLEM Part 1: Create a Car class in accordance with the following specifications. I will provide the CarClassTester class as a test driver to test your Car class for its basic structure. Do not change the CarClassTester class source code. After you get your Car class working correctly using this test driver, proceed to part 2 below. Car Class Specifications: The Car class must be in a separate package from any driver/tester program. The Car class will contain, at...
Part 1: Create a Car class in accordance with the following specifications. make model year fuel...
Part 1: Create a Car class in accordance with the following specifications. make model year fuel tank size fuel economy – fuel economy at best speed optimal speed Some of the other fields: odometer trip odometer color fuel level The Car class will also need at least 3 constructors: Car() Car(String, String, String, int, double, double, double) Car(Car) The Car class must implement the following methods. public fillTank(double): double public toString():String public equals(Car):boolean public driveCar():boolean public getTripOdometer():double public clearTripOdometer():void public...
Specifications: Write a Java program called LifeRaft.java that will do all of the following: Display a...
Specifications: Write a Java program called LifeRaft.java that will do all of the following: Display a title Ask the user to enter the following values: The type of plane(Boeing 747 or Airbus A300) The number of passengers on board the Plane The number of crew aboard the plane The maximum number of people that can be carried by one liferaft assuming all the liferafts on the plane are the same size The actual number of liferafts that are available on...
Specifications: This project will have two data classes and a tester class. Design: Create a solution...
Specifications: This project will have two data classes and a tester class. Design: Create a solution for this programming task. You will need to have the following parts: Text file to store data between runs. Two classes that implement the given interfaces. You may add methods beyond those in the interfaces A tester class that tests all of the methods of the data classes. Here are the interfaces for your data classes: package project1; import java.util.ArrayList; public interface Person {...
Specifications: This project will have two data classes and a tester class. Design: Create a solution...
Specifications: This project will have two data classes and a tester class. Design: Create a solution for this programming task. You will need to have the following parts: Text file to store data between runs. Two classes that implement the given interfaces. You may add methods beyond those in the interfaces A tester class that tests all of the methods of the data classes. Here are the interfaces for your data classes: package project1; import java.util.ArrayList; public interface Person {...
This is in Java 1. Create an application called registrar that has the following classes: a....
This is in Java 1. Create an application called registrar that has the following classes: a. A student class that minimally stores the following data fields for a student:  Name  Student id number  Number of credits  Total grade points earned             And this class should also be provides the following methods:  A constructor that initializes the name and id fields  A method that returns the student name field  A method that returns the student...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT