function filter_dom_load

cis7 filter.module filter_dom_load($text)
cle7 filter.module filter_dom_load($text)
elmsmedia7 filter.module filter_dom_load($text)
icor7 filter.module filter_dom_load($text)
meedjum_blog7 filter.module filter_dom_load($text)
mooc7 filter.module filter_dom_load($text)

Parses an HTML snippet and returns it as a DOM object.

This function loads the body part of a partial (X)HTML document and returns a full DOMDocument object that represents this document. You can use filter_dom_serialize() to serialize this DOMDocument back to a XHTML snippet.


$text: The partial (X)HTML snippet to load. Invalid mark-up will be corrected on import.

Return value

A DOMDocument that represents the loaded (X)HTML snippet.

2 calls to filter_dom_load()
_filter_html in modules/filter/filter.module
Implements callback_filter_process().
_filter_htmlcorrector in modules/filter/filter.module
Implements callback_filter_process().


modules/filter/filter.module, line 1097
Framework for handling the filtering of content.


function filter_dom_load($text) {
  $dom_document = new DOMDocument();
  // Ignore warnings during HTML soup loading.
  @$dom_document->loadHTML('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ""><html xmlns=""><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body>' . $text . '</body></html>');

  return $dom_document;



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.