| CS285 -- Lab 2: HTML/XML Validator |
|
|
OverviewIn this lab, you will write a program that validates the placement of HTML/XML markup commands. ProceduresText markup languages like HTML and XML make use of markup commands that are enclosed in less than/greater than symbols (e.g., <P>). All of the markup commands in XML and nearly all of the markup commands in HTML require an openning and closing command. The closing command is identical to the openning command with the addition of a forward slash immediately following the less than symbol. For example, in HTML, <B>Data Structures</B> will cause an HTML browser to display "Data Structures" in bold text. It should be noted that the openning markup command may contain modifiers. For example <FONT COLOR="#CC0000"> issues a font change command and indicates that the font should be colored red. All modifiers (there may be more than one) should be separated by spaces. The corresponding closing command should only contain the markup command and no modifiers. For this example, the closing markup command should be </FONT>. It is required that the markup commands be cleanly nested. That is, all markup commands must be terminated in the opposite order in which they were begun. Here are some examples:
Although not required, you may wish to add functionality to your program to accomodate the following:
You should test your program by running it from the DOS command prompt specifying the following three sample files: this XML, this one, and this XML and this webpage (lab2.htm). You should only run your program once to process all four files. Be sure to include the results of your program in your report. Lab report (due 11:00pm, the day prior to week 4 lab)Your report should include:
As with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic submission guidelines. (You may wish to consult the sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost. It may be wise to keep a diskette backup as well. Your grade will depend on quality of design, clarity of code and documentation, as well as whether your program produces the correct results. If you have any questions, consult your instructor. |
| © 2001 Dr. Christopher C. Taylor | Office: CC-27C | Phone: 277-7339 | Last Updated: January 3, 2001 |
| I am responsible for all content posted on these pages; MSOE is welcome to share these opinions but may not want to. | |||