ETL::Pipeline::Input::Xml - Records from an XML file
use ETL::Pipeline; ETL::Pipeline->new( { input => ['Xml', iname => 'Data.xml', root => '/Root'], mapping => {Name => 'Name', Address => 'Address'}, output => ['UnitTest'] } )->process;
ETL::Pipeline::Input::Xml defines an input source that reads multiple records from a single XML file. Individual records are repeating subnodes under "root".
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.
/XMLDATA/Root/Record
This can be any value accepted by Data::DPath. Fortunately, Data::Dpath takes paths that look like XPath for XML.
Not used. This attribute is ignored. XML files must follow specific formatting rules. Extra rows are parsed as data. There's nothing to skip.
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.
ETL::Pipeline, ETL::Pipeline::Input, ETL::Pipeline::Input::File, XML::Bare
Robert Wohlfarth <robert.j.wohlfarth@vumc.org>
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.
To install ETL::Pipeline, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ETL::Pipeline
CPAN shell
perl -MCPAN -e shell install ETL::Pipeline
For more information on module installation, please visit the detailed CPAN module installation guide.