// Parses the XML content
function parseXmlData ($content) {
- // Is there recode?
- if (!isPhpExtensionLoaded('recode')) {
- // No fallback ATM
- reportBug(__FUNCTION__, __LINE__, 'PHP extension recode is missing. Please install it.');
- } // END - if
-
// Convert HTML entities to UTF-8
- $content = recode('html..utf8', $content);
+ $decoded = decodeEntities($content);
// Create a new XML parser
$xmlParser = xml_parser_create();
xml_set_character_data_handler($xmlParser, 'xmlCharacterHandler');
// Now parse the XML tree
- if (!xml_parse($xmlParser, $content)) {
+ if (!xml_parse($xmlParser, $decoded)) {
// Error found in XML!
//* DEBUG: */ die('<pre>'.htmlentities($content).'</pre>');
reportBug(__FUNCTION__, __LINE__, 'Error found in XML. errorMessage=' . xml_error_string(xml_get_error_code($xmlParser)) . ', line=' . xml_get_current_line_number($xmlParser));