}
foreach($array as $key => $value) {
- if (!isset($element) AND isset($xml)) {
+ if (!isset($element) && isset($xml)) {
$element = $xml;
}
}
$element_parts = explode(":", $key);
- if ((count($element_parts) > 1) AND isset($namespaces[$element_parts[0]])) {
+ if ((count($element_parts) > 1) && isset($namespaces[$element_parts[0]])) {
$namespace = $namespaces[$element_parts[0]];
} elseif (isset($namespaces[""])) {
$namespace = $namespaces[""];
}
// Remove undefined namespaces from the key
- if ((count($element_parts) > 1) AND is_null($namespace)) {
+ if ((count($element_parts) > 1) && is_null($namespace)) {
$key = $element_parts[1];
}
if (substr($key, 0, 11) == "@attributes") {
- if (!isset($element) OR !is_array($value)) {
+ if (!isset($element) || !is_array($value)) {
continue;
}
foreach ($value as $attr_key => $attr_value) {
$element_parts = explode(":", $attr_key);
- if ((count($element_parts) > 1) AND isset($namespaces[$element_parts[0]])) {
+ if ((count($element_parts) > 1) && isset($namespaces[$element_parts[0]])) {
$namespace = $namespaces[$element_parts[0]];
} else {
$namespace = NULL;
if ($type == "open") { // The starting of the tag '<tag>'
$parent[$level-1] = &$current;
- if (!is_array($current) or (!in_array($tag, array_keys($current)))) { // Insert New tag
+ if (!is_array($current) || (!in_array($tag, array_keys($current)))) { // Insert New tag
$current[$tag] = $result;
if ($attributes_data) {
$current[$tag. '_attr'] = $attributes_data;
/**
* @brief Delete a node in a XML object
- *
+ *
* @param object $doc XML document
* @param string $node Node name
*/