Question: You will write a program to process XML formatted text, which is a mix of normal text and XML tags. A tag is always a

You will write a program to process XML formatted text, which is a mix of normal text and XML tags. A tag is always a string beginning with < and ending with >. Between those angle brackets, is a contiguous sequence of characters, that is, there is never whitespace inside a tag. An opening tag would be . A closing tag contains a forward slash as the first character inside: . A self-closing tag contains a forward slash as the last character inside:
.

Write a program named CountTagTypes that takes as input an XML text file where tags and text are separated by whitespace. The program should count and print the number of each type of tag: opening, closing, self-closing.

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!