Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Warning: DOMDocument::loadHTML(): Attribute alt redefined

I am running following code on CentOS

$roster = $utils->getContentCURL("http://exporter.nih.gov/ExPORTER_Catalog.aspx");
$docmp = new DOMDocument();
$docmp->loadHTML($roster);

it is giving me some warnings like

PHP Warning: DOMDocument::loadHTML(): Attribute alt redefined

Any idea, how to get rid of it?

like image 700
NKS Avatar asked Oct 21 '25 05:10

NKS


1 Answers

As the validation of the website tells you, there's several errors of alt defined twice. One example is on line 252:

<div align="center">
    <a 
        href="XMLData/final/RePORTER_PRJ_X_FY2013_088.zip" 
        title="Click here to download XML File format"
    >
        <img 
            src="images/xml_icon.gif" 
            alt="Click here to download XML format file" <!-- RIGHT THERE! -->
            width="41" 
            height="13" 
            border="0" 
            alt="" <!-- RIGHT THERE! -->
        />
    </a>
    <br/>
    <b>(~1 MB)</b>
</div>

If you own this website (do you?) then you should simply remove these (or maybe ask them to fix their website).

like image 67
h2ooooooo Avatar answered Oct 23 '25 21:10

h2ooooooo