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....
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: 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...
1. Create one XML data file and one DTD file for the entire data set (using...
1. Create one XML data file and one DTD file for the entire data set (using a subset of SQL assignment – see below). [Use of ID and IDREF are not required.] 2. Write and execute XML statements for the following two queries: Q1. Find the name of an employee who lives in Lincoln and works in Omaha. Q2. Find salaries of employees who live in the same cities as the companies for which they work. [You can replace one...
Problem 1 Create a new project called Lab7 Create a class in that project called ListORama...
Problem 1 Create a new project called Lab7 Create a class in that project called ListORama Write a static method in that class called makeLists that takes no parameters and returns no value In makeLists, create an ArrayList object called avengers that can hold String objects. Problem 2 Add the following names to the avengers list, one at a time: Chris, Robert, Scarlett, Clark, Jeremy, Gwyneth, Mark Print the avengers object. You will notice that the contents are displayed in...
1. Create a Word document in the Documents library. Write a small “summary or review” of...
1. Create a Word document in the Documents library. Write a small “summary or review” of an interesting “technology article” – The topics can be anything related to recent news in technology “Example: Launching of new gadgets of Apple, or Artificial Intelligence and its uses, Amazon Web Services etc” please include workcited
MATLAB based problem: Create a motoring model for the engine with the following specifications, and plot...
MATLAB based problem: Create a motoring model for the engine with the following specifications, and plot the in-cylinder pressure against (i) cylinder volume and (ii) crank angle degrees (20 points)  Bore = 107mm, stroke = 124mm, compression ratio = 17.3, Length of connecting rod = 192mm. Assume the ratio of specific heats is 1.4 (constant), atmospheric pressure is 1 bar and ambient temperature is 298 K.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT