Assignment 4:
Word, XML Documents and Schema Definitions
Due Date: Wednesday, March 07 by 6:00 pm.
Late Policy: This assignment will be accepted up to one (1) day late.
Assignments submitted after March 07 at 6:00 PM but before March 08 at 6:00 AM will be deducted 10% of the total grade.
Assignments submitted after March 08 at 6:00 AM but before March 08 at 6:00 PM will be deducted 25% of the total grade.
Assignments submission will be closed at 6:00 PM on March 08 and no assignments can be submitted to OWL after that time.
PLEASE READ ALL ( EVERY ONE ) OF THE INSTRUCTIONS CAREFULLY !!!!
Project 1: XML Document
Assignment Four will demonstrate the use of XML documents in transferring data. This will entail creating and validating an XML and XSD file and then upload that file to MS Access. Once successfully uploaded, the database will be completed by enforcing the referential integrity of the tables.
You are first provided with a completed and validated XML and XSD Schema document pair. These files are named:
Emp.xml Emp.xsd
You will need to also upload the Emp.xml document into your MS Access database in Project 3. IMPORTANT: before you upload the employee data file Emp.xml, you must change the name and
EmployeeID in the supplied Emp.xml file from the professor’s name to your own name and username.
Using a flat text editor (either: Brackets –or- NotePad++) you create an NEW XML data document. NOTE: Do NOT add on or change Emp.xml except for substituting your name and user name. Emp.xml and Emp.xsd are separate files from the files you are responsible to create.
You are given all the data required to fill in to your XML document in a text file called: DATA.txt (note: you must use ALL the characters exactly as they appear in the file – no changes)
NOTE: You are to replace the professor’s Contact ID (mmagg37) in the file with your UWO user ID.
This file is a list of vendors and their supplies that you purchase from each vendor
You will need to build an XML document and an associated XSD Schema file based on the data in the DATA.txt file. You must use the data exactly as shown, character by character or you will lose marks. So, quotation marks and punctuation must match what is in the file.
The data in DATA.txt is put into your XML file and MUST be structured with the following specifications:
Company Name (mandatory)
Company ID (Primary Key to identify each company entry – must be text) City (optional)
Province (optional)
Material Brand Name (mandatory – at least one (1) but no more than ten (10) materials allowed) Material Identification (mandatory – unique ID of the specific material)
Company ID Association (mandatory – must match the Company ID above)
Local (mandatory – MUST be true/false – cannot be text or number) Employee Contact ID (mandatory – only one contact allowed)
Phone Number (mandatory – only one phone number allowed)
Note: the tag for the major vendor groupings must have an optional tag attribute indicating the Order of Preference.
i.e. <tagName ORDER=orderNumber>
The assigned order number is also in the DATA.txt file before each major grouping.
hint: make sure you read Project 2 before starting.
hint: create the XML file with only ONE (1) company.
test (validate) syntax of the XML file
ONLY after syntax check create the XSD schema based on the XML file with ONE (1) company. ONLY after the schema validates the XML then add the other three (3) companies
[ONE AT A TIME] and retest.
This document MUST be validated by the schema in Project 2 by including the following line in your XML document:
<rootName xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”yourFileName.xsd”>
where rootName is the name of the root of your XML document and yourFileName is the name of the actual XSD Schema document you created in Project 2.
Your XML document must be a text file (NOT a Word Document) saved and submitted as an XML file (it MUST be a file with the extension .xml). Files with .doc or .txt extension will lose major marks.
The file name must be youraccountname_IT_MUST_VALIDATE.xml For example: jdoe3_IT_MUST_VALIDATE.xml
Note: Tutorials on HTML and XML are available at http://www.w3schools.com.
(HINT: Follow the steps from the class notes – especially in regards to the XML tags) read the Assignment 4 MUST READ.pdf document.
NOTE: Your XML file must validate, otherwise it cannot be uploaded into MS Access as required in Project 3. You will lose major marks if it does not validate. In past semesters students expressed confusion over this requirement. It must be valid as per the validation web site referenced below in these instructions. No exceptions – even regardless of what a TA may or may not say.
If you are unclear about the ‘must validate’ requirement, please contact me and I will be glad to give a further definition. I do not want the students to be unclear or feel that this has not been specified in advance.
You must use the XMLValidation site below. It provides more details on error messages: http://www.xmlvalidation.com
– it does not matter if another site says it is valid. This site only.
Your XML must be valid as per this web site. Run your XML file and Schema through this site.
(ensure you check the ‘Validate against external XML schema’ box on this page).
If this web site shows errors on your XML or Schema, you will lose almost all of the marks. Again,
contact me, or leave a message in the FORUMS in OWL if this is unclear.
IMPORTANT :
You must identify yourself in the XML documents (BOTH the XML and XSD). Somewhere towards the top (beginning) in the actual submitted XML and XSD files you must include:
– your first and last name
– your Western ID (see below for a description of your Western ID) – your student number
– the Date you completed the XML document
Your name and student Number and Student ID MUST MUST MUST appear in both (XML and XSD) documents or You will lose major marks on this project !!!
– NO EXCEPTIONS.
NOTE: Your XML file must validate, even after you add your name and ID to the document, otherwise it cannot be uploaded into MS Access as required in Project 2. You will lose major marks if it does not validate. In past semesters students expressed confusion over this requirement. It must be valid as per the validation web site referenced below in these instructions. AND! This can NOT be data. It can NOT be uploaded as part of your database.
STOP and think about how to add your name and ID inside the XML document where it is not data AND still have the XML validate! (hint: review the notes…)
Adding your identification incorrectly will result in the loss of major marks.
Your XML document must be a FLAT text file (NOT a Word Document (.doc) not a Text (.txt) Document ) saved and submitted as an XML file (it MUST be a file with the extension .xml). Files with a .doc or .txt extension will lose major marks.
Project 2: XML Schema
Using a text editor (either: Brackets –or- NotePad++) create an XML Schema (.xsd) document that will validate the Project 1 XML file you created.
Create the XML Schema using the information from your XML document,
The schema document needs to be designed to define your XML document in Project 1. The data types must match the specifications on page one (1) of this assignment.
Your schema definition must be a flat text file (NOT a Word Document) saved and submitted as an XML Schema Definition file (an .xsd file – files with a .doc or .txt extension will lose major marks).
The file name must start with your accountname followed by an underscore and then the word ‘vendors’
For example: jdoe3_vendors.xsd
IMPORTANT :
You must identify yourself in the XML documents (BOTH the XML and XSD). Somewhere towards the top (beginning) in the actual submitted XML and XSD files you must include:
– your first and last name
– your Western ID (see below for a description of your Western ID) – your student number
– the Date you completed the XML document
Your name and student Number and Student ID MUST MUST MUST appear in both (XML and XSD) documents or You will lose major marks on this project !!!
– NO EXCEPTIONS.
You must use the XMLValidation site below. It provides more details on error messages: http://www.xmlvalidation.com – it does not matter if another site says it is valid. This site only.
Your XML Schema must be valid as per this web site. Run your XML file and XML Schema through this site (ensure you check the ‘Validate against external XML schema’ box on this page).
If this web site shows errors on your XML or Schema, you will lose major marks. Again, contact me, or leave a message in the FORUMS in OWL if this is unclear.
Your XSD document must be a FLAT text file (NOT a Word Document (.doc) not a Text (.txt) Document ) saved and submitted as an XML file (it MUST be a file with the extension .xsd). Files with a .doc or .txt extension will lose major marks.
Project 3: Upload your XML Document into an MS Access Database
Create a new (blank) MS Access database. The name of your database must be: “youraccountname_vendors.accdb”.
Use the built in XML Import Utility found under the External Data tab.
Upload the following two XML documents into your newly created database: Emp.xml
youraccountname_IT_MUST_VALIDATE.xml (where youraccountname is YOUR UWO User ID)
IMPORTANT: before you upload the employee data file Emp.xml, you must change the name and EmployeeID in the supplied Emp.xml file from the professor’s name to your own name and username. You cannot enforce integrity if the username does not match your EmployeeID in the Emp.xml
Once the two files are uploaded successfully:
Use the Relationships utility in Database tools to create a relationship between the three (3) tables and then enforce referential integrity with this tool.
hint: you will need to manually make changes to the Employee and Vendor tables before you can enforce referential integrity. Think about how referential integrity works and look at the Properties view of each of these tables.
PLEASE GO BACK AND READ ALL OF THE INSTRUCTIONS CAREFULLY AGAIN !!!!
Project 4: Final Exam Multiple Choice Questions
Write five (5) multiple choice questions you think would be appropriate for the final exam. Base these questions on material covered in the slides or in class.
- Ensure that each multiple choice question has five choices
- Ensure that the majority of questions are framed in a positive context
(do not use questions that ask “Choose the option that does not belong)
- Avoid using “all of the above” or “none of the above” answer options, or answers
consisting of specific option numbers as possible responses.
- Provide the correct answer for each question.
This will help the professor to gage the level of difficulty expected by the students and will demonstrate the students proficiency in the material.
( …and, if I use your question(s) you will already know the answer(s) )
The format of this document should be identical to format you used in Assignment One (1).
Place your name, followed by the company name at the top.
At the end of the document, include your name, Student number and Western ID (the first part of your Western email (i.e. if your email is – dernt373@uwo.ca your ID will be – dernt373)
Formatting is not important as long as the document is easy to follow:This document must be a Word file saved and submitted as a .doc (or .docx) file
The name must be a combination of your Western Account Name and the name of your company. The file name must be youraccountname_companyname_A4.doc (or .docx)– example (from above) dernt373_MaggicSoftware_A4.docx
Submission Instructions:
You must upload and submit, via the CS1032 Web Site, the following four (4) files:youraccountname_IT_MUST_VALIDATE.xml youraccountname_vendors.xsd
youraccountname_vendors.accdb (.mdb for Access 2003 or earlier) youraccountname_companyname_A4.docx (.doc for Word 2003 or earlier)(remember to check your file names. They MUST match the required conventions above.) (if you submit files with incorrect extensions (for example: .txt) you will lose marks ! )
AND PLEASE: Do not cheat or copy.
It takes up a lot of time and energy going through the, ‘no, I did not phase’ followed by the ‘okay, but I need a break phase’
to finally the ‘what if I promise never to do it again phase’.