Lab Assignment: Data Structures in Java
In this lab you will you will write a program to validate html files.
In html, tags are element names enclosed in angle brackets <>. Most tags have start and end tags which enclose some document element(s) and possibly other tags. End tags have the same name as the corresponding start tag, preceded by a '/':
Arrays are objects, which means that when we declare an array, thename of the array is a reference
.
Start tags can contain attributes which provide additional information about the element, such as
Some tags do not surround any content. These "empty elements" have start tags but no end tags.
Restrictions for This Validator
There are multiple versions of html with different rules. We are going to simplify a bit for the purposes of this lab. We are going to use the following rules for valid html:
• tags are case insensitive
• the following tags are empty, and so have no corresponding close tag: , ,
,
,
,