}
try {
- $xml = new XML($this->optionImport['tmp_name']);
- $optionsXML = $xml->getElementTree('options');
- foreach ($optionsXML['children'] as $option) {
- $name = $value = '';
- foreach ($option['children'] as $optionData) {
- switch ($optionData['name']) {
- case 'name':
- $name = $optionData['cdata'];
- break;
- case 'value':
- $value = $optionData['cdata'];
- break;
- }
- }
-
- if (!empty($name)) {
- $this->options[$name] = $value;
- }
+ $xml = new XML();
+ $xml->load($this->optionImport['tmp_name']);
+ $xpath = $xml->xpath();
+ foreach ($xpath->query('/options/option') as $option) {
+ $this->options[ $xpath->query('name', $option)->item(0)->nodeValue ] = $xpath->query('value', $option)->item(0)->nodeValue;
}
}
catch (SystemException $e) {