PHP Classes

Got a lot of Unknown Errors below!

Recommend this page to a friend!

      HTMLPP  >  All threads  >  Got a lot of Unknown Errors below!  >  (Un) Subscribe thread alerts  
Subject:Got a lot of Unknown Errors below!
Summary:please let me know how to modify youe nice-looking class. thanks
Messages:4
Author:SUK HYUN
Date:2009-10-11 04:10:29
Update:2009-10-12 08:36:18
 

  1. Got a lot of Unknown Errors below!   Reply   Report abuse  
Picture of SUK HYUN SUK HYUN - 2009-10-11 04:10:29
Unknown Error: Non-static method HTMLFilterIterator::find() should not be called statically in example_HTMLPP.php on line 146
[debugHelper.php : 1074] [example_HTMLPP.php : 146] [example_HTMLPP.php : 146]
145 array(TEXT_NODE)
146 );
147

-------------------------------

$HTML=new HTMLPP;
//$HTML->loadHTMLFile("http://nexs.cjgls.com/web/tracking_hth_pop.jsp?slipno=312990514693");
$HTML->loadHTMLFile("http://www.mysite.com");
$HTML->stripComments(); //Now all comments are removed

$document = & $HTML->getDocument();

echo $HTML->render();




$func=create_function(
'$element,$index',
'if($element->textContent) return true; else return false;'
);
//Get all text nodes in the body sub tree that are not empty
$col4 =& HTMLFilterIterator::find(
$context,
$func,
HTML_SEARCH_DESCENDANT,
array(TEXT_NODE)
);

  2. Re: Got a lot of Unknown Errors below!   Reply   Report abuse  
Picture of Marco Marchiņ Marco Marchiņ - 2009-10-11 09:55:56 - In reply to message 1 from SUK HYUN
which PHP version do you have?

  3. Re: Got a lot of Unknown Errors below!   Reply   Report abuse  
Picture of Marco Marchiņ Marco Marchiņ - 2009-10-11 17:04:17 - In reply to message 1 from SUK HYUN
I've done a lot of tests today and i fixed some bugs so try to download the new version. Anyway i've tested it with PHP 4.3 and 5.2.8 and i didn't see the error that you have reported.
Reading your code i found that the $context variable is not declared so replace it with $document->body and then try again.
Please let me know if the error is still present and thank you for writing.

  4. Re: Got a lot of Unknown Errors below!   Reply   Report abuse  
Picture of SUK HYUN SUK HYUN - 2009-10-12 08:36:18 - In reply to message 3 from Marco Marchiņ
thanks for fast reply of your scripts.

I use PHP Version 5.2.5 and I will retry your new fantastic-looking code.