]> git.mxchange.org Git - mailer.git/blobdiff - inc/xml-functions.php
Continued a bit:
[mailer.git] / inc / xml-functions.php
index 54b494418b6bb31f0e95492ba8c6517400660cd1..ee135cfcc51c9baec19856651dfa9641dbe71e5e 100644 (file)
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Funktionen zum Umgang mit XML-Templates          *
  * -------------------------------------------------------------------- *
- * $Revision::                                                        $ *
- * $Date::                                                            $ *
- * $Tag:: 0.2.1-FINAL                                                 $ *
- * $Author::                                                          $ *
- * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2016 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -133,14 +128,8 @@ function addXmlSpecialElements ($template) {
 
 // Parses the XML content
 function parseXmlData ($content) {
-       // Is there recode?
-       if (!function_exists('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();
@@ -156,7 +145,7 @@ function parseXmlData ($content) {
        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));
@@ -308,7 +297,7 @@ function getSqlPartFromXmlArray ($columns) {
        // Walk through all entries
        foreach ($columns as $columnArray) {
                // Must be an array
-               assert(is_array($columnArray), 'columnArray[]=' . gettype($columnArray) . ' must be an array.');
+               assert(is_array($columnArray));
 
                // Init SQL part
                $sqlPart = '';
@@ -462,7 +451,7 @@ function searchXmlArray ($value, $columns, $childKey) {
        // Walk through whole array
        foreach ($columns as $key => $columnArray) {
                // Make sure the element is there
-               assert(isset($columnArray[$childKey]), 'columnArray[' . $childKey . '] is not set.');
+               assert(isset($columnArray[$childKey]));
 
                // Now is it what we are looking for?
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'value=' . $value . ',key=' . $key . ',childKey=' . $childKey . ',columnArray=' . $columnArray[$childKey]);