# jc-importer/2.7.14/class/Common/Importer/Preview/XMLNodePreview.php

Import WP – CSV &amp; XML Import Export for WordPress, version 2.7.14. 44 lines.

- Page: https://pluginprobe.com/plugins/jc-importer/2.7.14/code/class/Common/Importer/Preview/XMLNodePreview.php
- Raw: https://pluginprobe.com/plugins/jc-importer/2.7.14/raw/class/Common/Importer/Preview/XMLNodePreview.php
- Modified: 2020-09-22T19:27:48+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/jc-importer/2.7.14/code/class/Common/Importer/Preview/XMLNodePreview.php#L10-L20`.

```php
<?php

namespace ImportWP\Common\Importer\Preview;

use ImportWP\Common\Importer\File\XMLFile;
use ImportWP\Common\Importer\PreviewInterface;

class XMLNodePreview implements PreviewInterface
{

    /**
     * @var XMLFile $file
     */
    private $file;

    /**
     * XMLNodePreview constructor.
     *
     * @param \ImportWP\Common\Importer\File\XMLFile $file
     * @param array $args
     */
    public function __construct(XMLFile $file, $args = array())
    {
        $this->file = $file;
    }

    /**
     * Generate a list of possible XML Base nodes based on the XML data being previewed.
     *
     * @return string
     */
    public function output()
    {
        $output = '';
        $nodes  = $this->file->get_node_list();
        if (!empty($nodes)) {
            $output = implode('</li><li>', $nodes);
            $output = '<li>' . $output . '</li>';
        }

        return '<ul>' . $output . '</ul>';
    }
}

```
