// http://www.w3.org/TR/encoding/#encodings
// http://www.w3.org/TR/REC-xml/#NT-EncName
$content =
preg_replace_callback('/(charset *= *["\']?)([a-zA-Z\-0-9_:.]+)/i',
function D
$m) use (&
$charset) { if ('charset=' ===
$this->
convertToHtmlEntities('charset=',
$m[2
])) { $charset =
$m[2
];
} return $m[1
].
$charset;
},
$content, 1
);
if ('x' ===
$xmlMatches[1
]) { $this->
addXmlContent($content,
$charset);
} else { $this->
addHtmlContent($content,
$charset);
} } /**
* Adds an HTML content to the list of nodes.
*
* The libxml errors are disabled when the content is parsed.
*
* If you want to get parsing errors, be sure to enable
* internal errors via libxml_use_internal_errors(true)
* and then, get the errors via libxml_get_errors(). Be
* sure to clear errors with libxml_clear_errors() afterward.
*
* @return void
*/