So what went wrong? As a orderly guy i've used tidy to make the maybe not well formed xhtml document parseable for simplexml. Of course i've exported xhtml with tidy and pedantic tidy added namespaces in this case.
Obviously the solution was simply to use tidy with
output-html
instead of output-xhtml
option.I probably never encountered this problem if i've used this little workaround with domxml::loadHTML:
$dom = DOMDocument::loadHTML($html);
$page = simplexml_import_dom($dom);
I guess the dom function will fix most common issues with broken html.
No comments:
Post a Comment