Scroll to navigation

XML::Easy(3pm) User Contributed Perl Documentation XML::Easy(3pm)

NAME

XML::Easy - XML processing with a clean interface

SYNOPSIS

    use XML::Easy::NodeBasics qw(xml_element xml_e_attribute);
    use XML::Easy::Text qw(xml10_read_document xml10_write_document);
    $element = xml_element("a", { href => "there" }, "there");
    $element = xml10_read_document('<a href="there">there</a>');
    $href = xml_e_attribute($element, "href");
    $text = xml10_write_document($element);
    # see specific modules for many more functions

DESCRIPTION

XML::Easy is a collection of modules relating to the processing,parsing, and serialisation of XML data. It is oriented towards theuse of XML to represent data for interchange purposes, rather than theuse of XML as markup of principally textual data. It does not performany schema processing, and does not interpret DTDs or any other kindof schema. It adheres strictly to the XML specification, in all itsawkward details, except for the aforementioned DTDs.

XML::Easy strictly separates the in-program manipulation of XMLdata from the processing of the textual form of XML. This shieldsthe XML user from the inconvenient and obscure aspects of XML syntax.XML data nodes are mainly processed in a clean functional style, usingthe XML::Easy::NodeBasics module. In the (very likely) event thatan application requires some more purpose-specific XML data processingfacilities, they are readily built on top of XML::Easy::NodeBasics,retaining the abstraction from textual XML.

When XML must be handled in textual form, for input and output,the XML::Easy::Text module supplies a parser and a serialiser.The interfaces here, too, are functional in nature.

There are other modules for some ancillary aspects of XML processing.

MODULES

The modules in the XML::Easy distribution are:

This document. For historical reasons, this can also be loaded asa module, and (though it is deprecated) some of the functions fromXML::Easy::Text can be imported from here.
This module provides various type-testing functions, relating to datatypes used in the XML::Easy ensemble. These are mainly intended to beused to enforce validity of data being processed by XML-related functions.
These are classes used to represent XML data for general manipulation.Objects of these classes hold the meaningful content of the data,independent of textual representation. The data in these nodes cannotbe modified: different data requires new nodes.
This module supplies functions concerned with the creation, examination,and other manipulation of XML data nodes (content chunks and elements).The nodes are dumb data objects, best manipulated using plain functionssuch as the ones in this module.
This module supplies Perl regular expressions describing the grammar ofXML 1.0. This is intended to support doing irregular things with XML,rather than for normal parsing.
This module supplies functions that parse and serialise XML data as textaccording to the XML 1.0 specification.

OTHER DISTRIBUTIONS

Other CPAN distributions that work with XML::Easy are:

A testing tool, providing Test::More-style functions that checkwhether XML nodes are as expected.
Provides a way to construct XML data nodes by procedural code.Some programmers will find this more comfortable than the functionalstyle offered by XML::Easy::NodeBasics.
Helps to parse things that are encoded in XML in common ways.
"XML::Easy::Transform::"
This namespace exists to contain modules that perform transformationson XML documents, or parts thereof, in the form of XML::Easy::Elementand XML::Easy::Content nodes.

SEE ALSO

XML::Easy::Classify,XML::Easy::NodeBasics,XML::Easy::Syntax,XML::Easy::Text,<http://www.w3.org/TR/REC-xml/>

AUTHOR

Andrew Main (Zefram) <zefram@fysh.org>

COPYRIGHT

Copyright (C) 2008, 2009 PhotoBox Ltd

Copyright (C) 2009, 2010, 2011, 2017Andrew Main (Zefram) <zefram@fysh.org>

LICENSE

This module is free software; you can redistribute it and/or modify itunder the same terms as Perl itself.

2024-10-15 perl v5.40.0