Catmandu::Exporter::XSD(3pm) | User Contributed Perl Documentation | Catmandu::Exporter::XSD(3pm) |
Catmandu::Exporter::XSD - Export and validate XML documents
# Convert one shiporder YAML to XML catmandu convert YAML to XSD --root '{}shiporder' --schemas demo/order/*.xsd < shiporder.YAML # Same as above but store multiple shiporders in the YAML into a separate file catmandu convert YAML to XSD --root '{}shiporder' --schemas demo/order/*.xsd --split 1 < shiporder.YAML # Same as above but use template toolkit to pack the XML into an container # (The xml record is stored in the 'xml' key which can be retrieved in the # template by [% xml %]) catmandu convert YAML to XSD --root '{}shiporder' --schemas demo/order/*.xsd --template_before t/xml_header.tt --template t/xml_record.tt --template t/xml_footer.tt < shiporder.YAML use Catmandu; # Print to STDOUT my $exporter = Catmandu->exporter('XSD', root => ... schemas => ... ); $exporter->add_many($arrayref); $exporter->add_many($iterator); $exporter->add_many(sub { }); $exporter->add($hashref); $exporter->commit;
This is a Catmandu::Exporter for converting Perl into valided XML documents using an XSD schema file.
catmandu ... to XSD --root ... --schemas ... --split 1 < data
# Creates 000001.xml , 000002.xml, etc catmandu ... to XSD --root ... --schemas ... --split 1 --split_pattern '%-6.6d.xml' < data
{}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::Exporter, Catmandu::XSD , Template
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 |