How is this checking the content type of HTML elements? The content type of eg. the table element in HTML 5.1 is given by the following production (from [1]):
<!-- The table element
Content: In this order:
optionally a caption
element, followed by zero
or more colgroup
elements, followed
optionally by a thead
element, followed by
either zero or more tbody
elements or one or more
tr elements, followed
optionally by a tfoot
element, optionally
intermixed with one or
more script-supporting
elements. -->
<!ELEMENT table - -
(caption?,colgroup*,
thead,
(tbody*|tr+),tfoot?)
+(%scripting;)>
Regular content types are pretty fundamental to markup languages.