Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 945 Bytes

Xml.md

File metadata and controls

44 lines (31 loc) · 945 Bytes

XML Extractor

Extracts data from an XML file.

/** @var \Wizaplace\Etl\Extractors\Xml $xml */
$etl->extract($xml, 'path/to/file.xml', $options);

Options

Columns

Columns that will be extracted. If null, all tags and attributes within the loop path will be extracted.

Type Default value
array null

To select which columns will be extracted, use the path (without the loop path) of the value. Use @ to select attributes:

$options = [
    Xml::COLUMNS => [
        'id' => '/@id',
        'name' => '/profile/name',
        'email' => '/profile/email',
    ]
];

Loop

The path to loop through.

Type Default value
string /

To select which columns will be extracted, use the path (without the loop path) of the value. Use @ to select attributes:

$options = [Xml::LOOP => '/users/user'];