|
@@ 70-73 (lines=4) @@
|
| 67 |
|
// get the attributes first.; |
| 68 |
|
if (array_key_exists(self::$prefixAttributes . 'attributes', $data)) { |
| 69 |
|
foreach ($data[self::$prefixAttributes . 'attributes'] as $key => $value) { |
| 70 |
|
if (!self::isValidTagName($key)) { |
| 71 |
|
$msg = sprintf('[Array2XML] Illegal character in attribute name. attribute: %s in node: %s', $key, $nodeName); |
| 72 |
|
throw new \InvalidArgumentException($msg); |
| 73 |
|
} |
| 74 |
|
$node->setAttribute($key, self::bool2str($value)); |
| 75 |
|
} |
| 76 |
|
unset($data[self::$prefixAttributes . 'attributes']); //remove the key from the array once done. |
|
@@ 100-103 (lines=4) @@
|
| 97 |
|
if (is_array($data)) { |
| 98 |
|
// recurse to get the node for that key |
| 99 |
|
foreach ($data as $key => $value) { |
| 100 |
|
if (!self::isValidTagName($key)) { |
| 101 |
|
$msg = sprintf('[Array2XML] Illegal character in tag name. tag: %s in node: %s', $key, $nodeName); |
| 102 |
|
throw new \InvalidArgumentException($msg); |
| 103 |
|
} |
| 104 |
|
|
| 105 |
|
if (is_array($value) && reset($value) && is_numeric(key($value))) { |
| 106 |
|
// MORE THAN ONE NODE OF ITS KIND; |