Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ASAP Need Python Code for the following function with comments and screenshot of the code: 1. Matching tags in a Markup Language One of the

ASAP Need Python Code for the following function with comments and screenshot of the code:

image text in transcribed

image text in transcribed

1. Matching tags in a Markup Language One of the applications of Stack is in the validation of markup languages such as HTML, HTML is the standard format for hyperlinked documents on the Internet. We show a sample HTML document and a possible rendering in figure below: The Little Boat

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?
(a) The storm tossed the little boat like 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? (b) In a 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 "". For example, we see the tag on the first line of Figure (a), and the matching tag at the close of that document. Other commonly used HTML tags that are used in this example include: In a 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 "". For example, we see the tag on the first line of Figure (a), and the matching tag at the close of that document. Other commonly used HTML tags that are used in this example include: body: document body . .h1: section header center center justify p: paragraph ol: numbered (ordered) list li: list item Write a function isHtmlMatched (rawhtml) that takes raw html text and checks if the text has matching tags using Stack Note: 1. You are allowed to use a single Stack for this question 2. You can only use Stack functions (push, pop, top, is_empty) on Stack. 3. You can assume that the HTML input contains only commonly used tags given above (body, h1, center, p, ol, li). 1. Matching tags in a Markup Language One of the applications of Stack is in the validation of markup languages such as HTML, HTML is the standard format for hyperlinked documents on the Internet. We show a sample HTML document and a possible rendering in figure below: The Little Boat

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?
(a) The storm tossed the little boat like 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? (b) In a 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 "". For example, we see the tag on the first line of Figure (a), and the matching tag at the close of that document. Other commonly used HTML tags that are used in this example include: In a 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 "". For example, we see the tag on the first line of Figure (a), and the matching tag at the close of that document. Other commonly used HTML tags that are used in this example include: body: document body . .h1: section header center center justify p: paragraph ol: numbered (ordered) list li: list item Write a function isHtmlMatched (rawhtml) that takes raw html text and checks if the text has matching tags using Stack Note: 1. You are allowed to use a single Stack for this question 2. You can only use Stack functions (push, pop, top, is_empty) on Stack. 3. You can assume that the HTML input contains only commonly used tags given above (body, h1, center, p, ol, li)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

How can managers increase their employees job satisfaction?

Answered: 1 week ago

Question

write an algrothim flow chart and C program for marks in math>=65

Answered: 1 week ago