The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

ETL::Pipeline::Input::XmlFiles - Process XML content from individual files

SYNOPSIS

  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;

DESCRIPTION

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.

METHODS & ATTRIBUTES

Arguments for "input" in ETL::Pipeline

records_at

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.

You might use this attribute in two cases...

1. Multiple records per file. This is the top of each record, like in ETL::Pipeline::Input::Xml.
2. Shorthand to leave off extra nodes from every path. One record per file, but you don't want extra path parts on the beginning of every field.

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::List, 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.