Parsing HTML Attributes and Parameters
Learn and practice how to implement a fragmented attribute parser.
We'll cover the following
Implementing the FragmentAttributeParser
class
Parsing the parameters and attributes of our fragments will be similar to extracting the HTML fragments themselves. Instead of checking for characters such as the greater-than and less-than characters, we will use the presence of whitespace to determine attribute and parameter boundaries. Because parameter values can contain valid whitespace, we will use the same technique to skip over strings when parsing parameters to advance our parser over those problematic areas. Our implementation of this can be found below:
Get hands-on with 1400+ tech skills courses.