Neos.ContentRepository/Classes/Domain/Service/ImportExport/NodeImportService.php
public function import(\XMLReader $xmlReader, $targetPath, $resourceLoadPath = null)
    {
        $this->propertyMappingConfiguration = new ImportExportPropertyMappingConfiguration($resourceLoadPath);
        $this->nodeNameStack = [];

        if ($targetPath !== '/') {
            $pathSegments = explode('/', $targetPath);
            array_shift($pathSegments);
            $this->nodeNameStack = array_map(function ($pathSegment) {
                return Utility::renderValidNodeName($pathSegment);
            }, $pathSegments);
        }

        $formatVersion = $this->determineFormatVersion($xmlReader);
        switch ($formatVersion) {
            case self::SUPPORTED_FORMAT_VERSION:
                $this->securityContext->withoutAuthorizationChecks(function () use ($xmlReader) {
                    $this->importSubtree($xmlReader);
                });
                break;
            case null:
                throw new ImportException('Failed to recognize format of the Node Data XML to import. Please make sure that you use a valid Node Data XML structure.', 1409059346);
            default:
                throw new ImportException('Failed to import Node Data XML: The format with version ' . $formatVersion . ' is not supported, only version ' . self::SUPPORTED_FORMAT_VERSION . ' is supported.', 1409059352);
        }
    }
public function import(\XMLReader $xmlReader, $targetPath, $resourceLoadPath = null)
    {
        $this->propertyMappingConfiguration = new ImportExportPropertyMappingConfiguration($resourceLoadPath);
        $this->nodeNameStack = [];

        if ($targetPath !== '/') {
            $pathSegments = explode('/', $targetPath);
            array_shift($pathSegments);
            $this->nodeNameStack = array_map(function ($pathSegment) {
                return Utility::renderValidNodeName($pathSegment);
            }, $pathSegments);
        }

        $formatVersion = $this->determineFormatVersion($xmlReader);
        switch ($formatVersion) {
            case self::SUPPORTED_FORMAT_VERSION:
                $this->securityContext->withoutAuthorizationChecks(function () use ($xmlReader) {
                    $this->importSubtree($xmlReader);
                });
                break;
            case null:
                throw new ImportException('Failed to recognize format of the Node Data XML to import. Please make sure that you use a valid Node Data XML structure.', 1409059346);
            default:
                throw new ImportException('Failed to import Node Data XML: The format with version ' . $formatVersion . ' is not supported, only version ' . self::SUPPORTED_FORMAT_VERSION . ' is supported.', 1409059352);
        }
    }
public function import ( \ XMLReader $ xmlReader , $ targetPath , $ resourceLoadPath = null ) { $ this -> propertyMappingConfiguration = new ImportExportPropertyMappingConfiguration ( $ resourceLoadPath ) ; $ this -> nodeNameStack = [ ] ; if ( $ targetPath !== '/' ) { $ pathSegments = explode ( '/' , $ targetPath ) ; array_shift ( $ pathSegments ) ; $ this -> nodeNameStack = array_map ( function ( $ pathSegment ) { return Utility :: renderValidNodeName ( $ pathSegment ) ; } , $ pathSegments ) ; } $ formatVersion = $ this -> determineFormatVersion ( $ xmlReader ) ; switch ( $ formatVersion ) { case self :: SUPPORTED_FORMAT_VERSION : $ this -> securityContext -> withoutAuthorizationChecks ( function ( ) use ( $ xmlReader ) { $ this -> importSubtree ( $ xmlReader ) ; } ) ; break ; case null : throw new ImportException ( 'Failed to recognize format of the Node Data XML to import. Please make sure that you use a valid Node Data XML structure.' , 1409059346 ) ; default : throw new ImportException ( 'Failed to import Node Data XML: The format with version ' . $ formatVersion . ' is not supported, only version ' . self :: SUPPORTED_FORMAT_VERSION . ' is supported.' , 1409059352 ) ; } }
Imports the sub-tree from the xml reader into the given target path.

The root node of the imported tree becomes a child of the node specified as the target path,
as the following example illustrates:

1. Existing Nodes Before Import:

path
- to
- - my
- - - targetNode
- - - - A
- other
- - nodes

2. Sub-tree in xml to import to 'path/to/my/targetNode':

<B>
- <B1/>
</B>

3. existing nodes after the import:

path
- to
- - my
- - - targetNode
- - - - A
- - - - B
- - - - - B1
- another
- - sub-tree

@param \XMLReader $xmlReader The XML input to import - must be either XML as a string or a prepared \XMLReader instance containing XML data
@param string $targetPath path to the node which becomes parent of the root of the imported sub-tree
@param string $resourceLoadPath
@throws ImportException
@return void
Imports the sub - tree from the xml reader into the given target path .