Searching <img/> elements for obsoleted attributes.

exercise No. 63

Q:

Consider the following XHTML document instance example:

<html xmlns='http://www.w3.org/1999/xhtml'>
    <head>
        <title>A simple image</title>
    </head>
    <body>
        <img src='a.gif' align='top'/>

        <p>Some inline image without alignment <img src="b.gif"/></p>
        <p>Some inline image with alignment <img src="c.gif" align="bottom"/></p>
    </body>
</html>

This instance contains three <img/> elements. Two of them have an old style align property. Modern HTML versions prohibit this usage in favour of CSS <img style="vertical-align: text-top;" />.

Write an application which produces the following list of non-conforming images:

Found image element 'a.gif' having attribute align='top'
Found image element 'c.gif' having attribute align='bottom'

Write your application in a testable fashion and provide unit test(s).

A: