X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fxml-functions.php;h=601137807380afd475edfebdc27761db630a832f;hb=9b06a0b9b72fbdaf5bf638df82ae37c56a5654cb;hp=8958bdb157f30000cfa7ccc8dfcd1ee7f2bb4701;hpb=d6417790061e18fc1a9770ff93bb4e9d106b2f6e;p=mailer.git diff --git a/inc/xml-functions.php b/inc/xml-functions.php index 8958bdb157..6011378073 100644 --- a/inc/xml-functions.php +++ b/inc/xml-functions.php @@ -185,7 +185,9 @@ function xmlCharacterHandler ($resource, $characters) { // Nothing to handle return; } // END - if - die('characters[]='.strlen($characters)); + + // @TODO Handle characters + die(__FUNCTION__ . ':characters[]='.strlen($characters)); } // Checks if given type is valid, makes all lower-case @@ -194,7 +196,16 @@ function isInvalidXmlType ($type) { $type = strtolower(trim($type)); // Is it found? - return (in_array($type, array('string', 'array', 'bool', 'int'))); + return (in_array($type, array('string', 'array', 'bool', 'int', 'callback'))); +} + +// Checks if given condition is valid +function isXmlConditionValid ($condition) { + // Trim and make lower-case + $condition = trim(strtolower($condition)); + + // Is it valid? + return (in_array($condition, array('equals'))); } // Checks if given value is valid/verifyable @@ -212,5 +223,25 @@ function isXmlValueValid ($type, $value) { return call_user_func_array($callbackFunction, array($value)); } +// Converts given condition into a symbol +function convertXmlContion ($condition) { + // Default is an invalid one + $return = '???'; + + // Detect the condition again + switch ($condition) { + case 'EQUALS': // Equals + $return = '='; + break; + + default: // Unknown condition + debug_report_bug(__FUNCTION__, __LINE__, 'Condition ' . $condition . ' is unknown/unsupported.'); + break; + } // END - switch + + // Return it + return $return; +} + // [EOF] ?>