Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2) Build the DOM tree (20 points): For a valid HTML page, we can view the Document Object Model (DOM) for the page. As each
2) Build the DOM tree (20 points): For a valid HTML page, we can view the Document Object Model (DOM) for the page. As each tag is nested within another, we can view the page as a tree-like object. In this case, we can consider the root of the tree as the html tag, and then everything falls as a descendent. For this part, you should complete the definition of Tag* generate_DOM_tree (const std::string& document) where: Each tag should be represented by a Tag object within the tree. Any text within a tag should be put into a Tag object with the name value "content" o Tag objects with the name "content" should never contain empty content strings. CSE 250 Spring 2017 Tag objects should contain: name -the tag name (e.g., html, head, etc.) id-the id assigned by the id attribute within the tag. Leave as an empty string if none is given in the tag. o o o content for any tag other than "content" or "title" this should be left empty. For content" and "title" tags this should never be empty. displayed-leave this as false for now. children - an object of type std::vector
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started