Modern DOM library written in PHP for HTML documents
J. King
bb2a7b5a95
Everything which can emit a parse error should have the error handler and data stream as properties and use the ParseErrorEmitter trait to avoid complicating the task of actually producing an error. Normally the Parser would be expected to set the error handler before it begins (this commit does not do this) and unset it after it's done. Alternatively, the entire means of reporting errors can now be easily replaced. |
||
---|---|---|
lib | ||
tests | ||
vendor-bin | ||
.gitignore | ||
AUTHORS | ||
composer.json | ||
composer.lock | ||
LICENSE | ||
README.md | ||
robo | ||
robo.bat | ||
RoboFile.php |
HTML5
Tools for parsing and printing HTML5 documents and fragments.
<?php
$dom = dW\HTML5\Parser::parse('<!DOCTYPE html><html lang="en" charset="utf-8"><head><title>Ook!</title></head><body><h1>Ook!</h1><p>Ook-ook? Oooook. Ook ook oook ook oooooook ook ooook ook.</p><p>Eek!</p></body></html>');
?>
or:
<?php
$dom = new dW\HTML5\Document;
$dom->loadHTML('<!DOCTYPE html><html lang="en" charset="utf-8"><head><title>Ook!</title></head><body><h1>Ook!</h1><p>Ook-ook? Oooook. Ook ook oook ook oooooook ook ooook ook.</p><p>Eek!</p></body></html>');
?>