But with the current firmware of the day (1.0.0.22) it sends INVALID HTML (as reported by the w3c checker). I am not an expert in parsing (domDocument in php is clever but not brilliantly documented for the newcomer) and it took me a couple of hours to trace this problem. Thanks HA7 net!
The problem is that the HA7net adds a hidden element like this:
but it neglects to wrap this in "TD" tags - it sits after the last closing /TD but before the /TR on each line
For now, I have written a bit of PHP to correct it:
function mendEDSbrokenHTM($content){
$output;
$delimInput="
$delimCloseTR="";
//add
$tA=explode($delimInput,$content); //will produce n+1 elements
$output=$tA[0];
for ($b=1; $b
$tB=explode($delimCloseTR,$tA[$b],2);
$output.="
}
return $output;
}
(this isn't perfect: there will be more cells in each data row than in the header row. But it worked well enough for me).
But why should I have to muck around like this? - Easy-to-parse HTML is a key selling point on this supposedly mature system.
Not a good first encounter with the HA7net.
No comments:
Post a Comment