Skip to content
Snippets Groups Projects
Commit 7c7c2d7d authored by Brian Osborne's avatar Brian Osborne Committed by Mike Ryan
Browse files

Issue #2860785 by bkosborne: Allow XML elements to pass through as field...

Issue #2860785 by bkosborne: Allow XML elements to pass through as field values to process plugins (for SimpleXML processor)
parent 8b68f193
No related branches found
No related tags found
No related merge requests found
...@@ -67,7 +67,12 @@ class SimpleXml extends DataParserPluginBase { ...@@ -67,7 +67,12 @@ class SimpleXml extends DataParserPluginBase {
if ($target_element !== FALSE && !is_null($target_element)) { if ($target_element !== FALSE && !is_null($target_element)) {
foreach ($this->fieldSelectors() as $field_name => $xpath) { foreach ($this->fieldSelectors() as $field_name => $xpath) {
foreach ($target_element->xpath($xpath) as $value) { foreach ($target_element->xpath($xpath) as $value) {
$this->currentItem[$field_name][] = (string) $value; if ($value->children() && !trim((string) $value)) {
$this->currentItem[$field_name] = $value;
}
else {
$this->currentItem[$field_name][] = (string) $value;
}
} }
} }
// Reduce single-value results to scalars. // Reduce single-value results to scalars.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment