foo HTML; $dom->load($str); assert($dom->find('div', 0)==$str); // ----------------------------------------------- $str = <<foo HTML; $dom->load($str); assert($dom->find('div', 0)==$str); // ----------------------------------------------------------------------------- // innertext test $str = <<
foo HTML; $dom->load($str); assert($dom==$str); // ----------------------------------------------- $str = <<
bar HTML; $dom->find('span', 0)->innertext = 'bar'; assert($dom==$str); // ----------------------------------------------- $str = <<ok
bar HTML; $dom->find('head', 0)->innertext = 'ok'; assert($dom==$str); // ----------------------------------------------------------------------------- // outertext test $str = << Head1Head2Head3 123 HTML; $dom->load($str); assert($dom->find('tr', 0)->outertext=='Head1Head2Head3'); assert($dom->find('tr', 1)->outertext=='123'); // ----------------------------------------------- $str = <<Head1Head2Head3123 HTML; $dom->load($str); assert($dom->find('tr', 0)->outertext=='Head1Head2Head3'); assert($dom->find('tr', 1)->outertext=='123'); // ----------------------------------------------- $str = <<
  • li11
  • li12
  • HTML; $dom->load($str); assert($dom->find('ul', 0)->outertext==''); assert($dom->find('ul', 1)->outertext==''); // ----------------------------------------------- $str = <<
  • li11
  • li12