homework4 - Homework XML Exercise 1 Objectives Become...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Homework: XML Exercise 1. Objectives Become familiar with the DOM paradigm; Use an existing XML parser; Transform the content of an XML document into an HTML page. 2. Description You are required to write a HTML/JavaScript program, which takes the URL of an XML document containing product information, parses the XML file, and displays it as a table in an HTML document. The HTML/JavaScript program will be implemented embedded in a HTML file so that it can be executed within a browser. Your program should display a single text box that allows the entering of an arbitrary URL of an XML document. The interface might look like the following: You can implement this form using only HTML. The form, once the “Submit Query” button is clicked, would call a HTML/JavaScript function within the HTML file that parses the XML document given as input and generates an HTML table containing the data within the XML document. Use the XML DOM Parser that comes as a built-in COM component in both IE and Firefox to parse and validate the XML document. Your code can assume that the XML files that your program will process will be structured as a “two level tree”. See Section 3, Step 1 for details. After parsing the XML document, a new window should be displayed which contains an HTML table which includes the same content as the XML document.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 If the XML file is invalid (e.g. missing the closing tag or having tags that overlap), an error message should be generated in a popup window. Here are two examples. Given the following two XML documents http://www-scf.usc.edu/~csci571/2010Fall/hw4/flower.xml Your program should end up producing the following web page. Table generated from flower.xml
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 5

homework4 - Homework XML Exercise 1 Objectives Become...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online