Question 1

You are asked to create an HTML document that uses DOM and JavaScript to display the contents of the above XML document in the browser. You may use the firstChild/nextSibling methods, getElementsByTagName method, an iteration method, or even a recursive method. However, as a catch, you should know the ontology of your document and prefix the content you display with descriptive prefixes related to data content. For example: Enterprise data exchange should be prefixed by Title.

You are not required to write a working JavaScript program. If you are not familiar with JavaScript, you can write a pseudo code or an essay to explain how it works instead.

Hint for JavaScript program, you can follow the JavaScript example in chapter 11 - The XML Document Object Model: The Node Object - The Effect of Text Nodes. Your code should be only one HTML document and be turned in as an attachment. You should test your code in your browser before submitting the assignment.

Question 2

Now write a java program that uses SAX parser to print the contents of the above XML document. The java program you write should use the SAX event handling functions. As an output, you should see the ontology of your document and descriptive prefixes related to corresponding data content.

You are not required to write a working java program. If you are not familar with Java, you can write a pseudo code or an essay to explain how it works instead.

Hint for java program, you can follow the Java example "TrainReader" in chapter 12 - Simple API for XML (SAX). Your code should be in only one java file, and only this java file will be turned in as an attachment. You should test your code before submitting the assignment.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.