Catmandu::Importer::XSD(3pm) | User Contributed Perl Documentation | Catmandu::Importer::XSD(3pm) |
Catmandu::Importer::XSD - Import and validate serialized XML documents
# Compile an XSD schema file and parse one shiporder.xml file catmandu convert XSD --root '{}shiporder' --schemas demo/order/*.xsd to YAML < shiporder.xml # Same as above but parse more than one file into an array of records catmandu convert XSD --root '{}shiporder' --schemas demo/order/*.xsd --files 'data/*.xml' to YAML # Same as above but all array of records are in a XML container file catmandu convert XSD --root '{}shiporder' --schemas demo/order/*.xsd --xpath '/Container/List//Record/Payload/*' to YAML < data/container.xml # In Perl use Catmandu; my $importer = Catmandu->importer('XSD', file => 'ex/data.xml' root => ..., schemas => [ ...] ); my $n = $importer->each(sub { my $hashref = $_[0]; # ... });
This is a Catmandu::Importer for parsing and validating XML data using one or more XSD schema files.
catmandu ... --files 'data/input/*.xml'
catmandu convert XSD --root {}shiporder --schemas "t/demo/ead/*xsd" --example 1 to YAML
{}shiporder {http://www.loc.gov/mods/v3}mods {urn:isbn:1-931666-22-9}ead
# On the command line: catmandu ... --prefixes ead:urn:isbn:1-931666-22-9,... # In Perl prefixes => [ ead => 'urn:isbn:1-931666-22-9' , ... => ... ]
Every Catmandu::Importer is a Catmandu::Iterable all its methods are inherited.
Catmandu::Importer, Catmandu::XSD
Patrick Hochstenbach , "patrick.hochstenbach at ugent.be"
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See <http://dev.perl.org/licenses/> for more information.
2022-11-29 | perl v5.36.0 |