-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
There is no way to use the xPath functions in import configs.
Following method and its usages could be adjusted to return and use besides the DOMNodeList the string value:
external_import/Classes/Handler/XmlHandler.php
Lines 359 to 369 in 754e795
| public function selectNodeWithXpath(\DOMXPath $xPathObject, string $xPath, ?\DOMNode $context = null): \DOMNodeList | |
| { | |
| $resultNodes = $xPathObject->evaluate($xPath, $context); | |
| if ($resultNodes->length > 0) { | |
| return $resultNodes; | |
| } | |
| throw new \Exception( | |
| 'No node found with xPath: ' . $xPath, | |
| 1399497464 | |
| ); | |
| } |
This will allow composite-identities in configs:
'composite_uid' => [
'external' => [
'index_a' => [
'xpath' => 'concat(../@parents_element_uid_attr, ":", @child_element_uid_attr)',
],
],
],
Beside of that there is cool feature on core PHP, which could be fine on that extension: https://www.php.net/manual/en/domxpath.registerphpfunctions.php
@fsuter @COBWEB
I patched the EXT:external_import minimal(there is a little bit more requiered for full support by EXT:external_import) in my project, would you like to extend the code if I push it and create a pull-request?
Metadata
Metadata
Assignees
Labels
No labels