I have 2 tables in my page ,each with separate ids, see source.
[text]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>Tab12</title>
</head>
<body>
<table id="tab1">
<tbody>
<tr>
<td id="f0"></td>
<td id="f1"></td>
</tr>
</tbody>
</table>
<table id="tab2">
<tbody>
<tr>
<td id="f0"></td>
<td id="f1"></td>
</tr>
</tbody>
</table>
</body>
</html>
[/text]
But when I load it with DOM PHP code ..
Code: Select all
<?php
/*** a new dom object ***/
$dom = new domDocument;
/*** load the html into the object ***/
$dom->loadHTMLFILE('Tab12.html');
$str = $dom->saveHTML();
echo $str;
?>
Warning: DOMDocument::loadHTMLFile() [domdocument.loadhtmlfile]: ID f0 already defined in Tab12.html, line: xx in
I would have though that as the ids are in separate nodes they would be OK.
But perhaps not.
Anyone know if this is correct.
Thanks Jim