The problem is that it is that the node “td” containing the value “<1” is selected but the value is not outputed - the result is empty str. - " ".
I’ve tried like this , but it is still not working.
should i register a namespace for that element to be able to receive the value
in it.
i didn’t find the edit button , so i am posting a new one , may i be excused.
I’ve made some testing and it turns out that the problem is in the “loadHTML()” function.
It doesn’t read the value in the tag - “<td>< 1</td>” i.e. “< 1” , but i have it the HTML file.
The problem is not in XPath .
How to load that value into the php script ?
The [COLOR="DarkRed"]<td align="center">< 1</td>[/COLOR] is broken HTML as far as PHP is concerned.
When PHP loads the HTML, it does its best to figure out what was intended and interprets the HTML as [COLOR="DarkRed"]<td align="center"></td>[/COLOR]. Note the missing [COLOR="DarkRed"]< 1[/COLOR], which explains why you got an empty string!
It looks like you’re using Zend_Query for this (are you?) which does not help much since it is hard-coded to silence any warnings generated when PHP spots problems with the HTML.
i was going with zend_dom_query ,but then switched back to php.
Now that you’ve mention it php does trow a warning.
Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseStartTag: invalid element name in Entity, line: 158 in C:\\xampp\\htdocs\\xXxXx\\application\\controllers\\IndexController.php on line 66
I am pretty convinced now , that i should escape the “<” character.