Searching <img/> elements for obsoleted attributes.

exercise No. 63

Create comment in forum


Consider the following XHTML document instance example:

<html xmlns=''>
        <title>A simple image</title>
        <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>

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).