NAME
ETL::Pipeline::Input::Xml - Records from an XML file
SYNOPSIS
use ETL::Pipeline;
ETL::Pipeline->new( {
input => ['Xml', iname => 'Data.xml', root => '/Root'],
mapping => {Name => 'Name', Address => 'Address'},
output => ['UnitTest']
} )->process;
DESCRIPTION
ETL::Pipeline::Input::Xml defines an input source that reads multiple records from a single XML file. Individual records are repeating subnodes under "root".
METHODS & ATTRIBUTES
Arguments for "input" in ETL::Pipeline
records_at
Required. The path to the record nodes, such as /XMLDATA/Root/Record
. The last item in the list is the name of the root for each individual record. The code loops over all of these nodes.
This can be any value accepted by Data::DPath. Fortunately, Data::Dpath takes paths that look like XPath for XML.
skipping
Not used. This attribute is ignored. XML files must follow specific formatting rules. Extra rows are parsed as data. There's nothing to skip.
Methods
run
This is the main loop. It opens the file, reads records, and closes it when done. This is the place to look if there are problems.
ETL::Pipeline automatically calls this method.
SEE ALSO
ETL::Pipeline, ETL::Pipeline::Input, ETL::Pipeline::Input::File, XML::Bare
AUTHOR
Robert Wohlfarth <robert.j.wohlfarth@vumc.org>
LICENSE
Copyright 2021 (c) Vanderbilt University Medical Center
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.