ETL::Pipeline::Input::XmlFiles - Process XML content from individual files
use ETL::Pipeline; ETL::Pipeline->new( { input => ['XmlFiles', iname => qr/\.xlsx$/i, records_at => '/Xml'], mapping => {First => '/File/A', Second => '/File/Patient'}, output => ['UnitTest'] } )->process;
ETL::Pipeline::Input::XmlFiles defines an input source that reads one or more records from one or more XML files. Most of the time, there should be one record per file. But the class handles multiple records per file too.
Optional. 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 default is / - one record in the file.
/XMLDATA/Root/Record
You might use this attribute in two cases...
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::List, 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.