Neos\ContentRepository\Domain\Service\ImportExport\NodeImportService::importSubtree PHP Method

importSubtree() protected method

The root node of the imported tree becomes a child of the node specified by target path. This parser uses the depth-first reading strategy, which means it will read the input from top til bottom.
protected importSubtree ( XMLReader $xmlReader ) : void
$xmlReader XMLReader A prepared XML Reader with the structure to import
return void
    protected function importSubtree(\XMLReader $xmlReader)
    {
        while ($xmlReader->read()) {
            if ($xmlReader->nodeType === \XMLReader::COMMENT) {
                continue;
            }
            switch ($xmlReader->nodeType) {
                case \XMLReader::ELEMENT:
                    if (!$xmlReader->isEmptyElement) {
                        $this->parseElement($xmlReader);
                    }
                    break;
                case \XMLReader::END_ELEMENT:
                    if ((string) $xmlReader->name === 'nodes') {
                        return;
                        // all done, reached the closing </nodes> tag
                    }
                    $this->parseEndElement($xmlReader);
                    break;
            }
        }
    }