HTML; $dom->load($str); assert(count($dom->find('input'))==0); // ----------------------------------------------------------------------------- // test $str = << HTML; $dom->load($str); assert(count($dom->find('code'))==1); assert(count($dom->find('input'))==0); // ----------------------------------------------------------------------------- //
 &  test
$str = <<
    
HTML; $dom->load($str); assert(count($dom->find('pre'))==1); assert(count($dom->find('input'))==0); // ----------------------------------------------------------------------------- // HTML; $dom->load($str); assert(count($dom->find('style'))==1); assert(count($dom->find('script'))==3); // ----------------------------------------------------------------------------- // php short tag test $str = <<hello HTML; $dom->load($str); assert($dom->find('a', 0)->href===""); assert($dom->find('input', 0)->value===""); // ----------------------------------------------------------------------------- // noise stripping test $str = <<--> HTML; $dom->load($str); assert(count($dom->find('img'))==1); assert($dom==$str); // ----------------------------------------------- $str = <<ss HTML; $dom->load($str); assert(count($dom->find('script'))==8); assert(count($dom->find('style'))==3); //echo "\n\n\n\n".$dom->save(); assert($dom==$str); // ----------------------------------------------------------------------------- // tear down $dom->clear(); unset($dom); ?>