Question: Objective (1): Using Stack to match HTML tag In an HTML document, portions of text are delimited by HTML tags. A simple opening HTML tag

Objective (1): Using Stack to match HTML tag

In an HTML document, portions of text are delimited by HTML tags.

A simple opening HTML tag has the form and the corresponding

Closing tag has the form

Example: ;

  • Using java.util.Stack to write a java program to validate the input file

    html.dat. Display The input file is a matched HTML document if there is

    no mismatch found otherwise display the mismatched tag or any other

    invalid HTML format. (2 points)

    //html.dat file

    The Little Boat

    The storm tossed the little boat like a cheap sneaker in an old washing machine. The three drunken fishermen were used to such treatment, of course, but not the tree salesman, who even as a stowaway now felt that he had overpaid for the voyage.

    1. Will the salesman die?
    2. What color is the boat?
    3. And what about Naomi?

    Step by Step Solution

    There are 3 Steps involved in it

    1 Expert Approved Answer
    Step: 1 Unlock blur-text-image
    Question Has Been Solved by an Expert!

    Get step-by-step solutions from verified subject matter experts

    Step: 2 Unlock
    Step: 3 Unlock

    Students Have Also Explored These Related Databases Questions!