File Coverage

blib/lib/XML/Easy.pm
Criterion Covered Total %
statement 11 11 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 15 15 100.0


line stmt bran cond sub pod time code
1             =head1 NAME
2              
3             XML::Easy - XML processing with a clean interface
4              
5             =head1 SYNOPSIS
6              
7             use XML::Easy::NodeBasics qw(xml_element xml_e_attribute);
8             use XML::Easy::Text qw(xml10_read_document xml10_write_document);
9              
10             $element = xml_element("a", { href => "there" }, "there");
11             $element = xml10_read_document('there');
12              
13             $href = xml_e_attribute($element, "href");
14             $text = xml10_write_document($element);
15              
16             # see specific modules for many more functions
17              
18             =head1 DESCRIPTION
19              
20             L is a collection of modules relating to the processing,
21             parsing, and serialisation of XML data. It is oriented towards the
22             use of XML to represent data for interchange purposes, rather than the
23             use of XML as markup of principally textual data. It does not perform
24             any schema processing, and does not interpret DTDs or any other kind
25             of schema. It adheres strictly to the XML specification, in all its
26             awkward details, except for the aforementioned DTDs.
27              
28             L strictly separates the in-program manipulation of XML
29             data from the processing of the textual form of XML. This shields
30             the XML user from the inconvenient and obscure aspects of XML syntax.
31             XML data nodes are mainly processed in a clean functional style, using
32             the L module. In the (very likely) event that
33             an application requires some more purpose-specific XML data processing
34             facilities, they are readily built on top of L,
35             retaining the abstraction from textual XML.
36              
37             When XML must be handled in textual form, for input and output,
38             the L module supplies a parser and a serialiser.
39             The interfaces here, too, are functional in nature.
40              
41             There are other modules for some ancillary aspects of XML processing.
42              
43             =head2 Minimum Perl Version
44              
45             While the code in this library's modules was originally written to accommodate
46             perl-5.8, its prerequisites are in large part no longer working on that
47             version of F. So as of XML-Easy-0.012 we will set perl-5.10.1 as our
48             recommended minimum Perl version.
49              
50             =head1 MODULES
51              
52             The modules in the L distribution are:
53              
54             =over
55              
56             =item L
57              
58             This document. For historical reasons, this can also be loaded as
59             a module, and (though it is deprecated) some of the functions from
60             L can be imported from here.
61              
62             =item L
63              
64             This module provides various type-testing functions, relating to data
65             types used in the L ensemble. These are mainly intended to be
66             used to enforce validity of data being processed by XML-related functions.
67              
68             =item L
69              
70             =item L
71              
72             These are classes used to represent XML data for general manipulation.
73             Objects of these classes hold the meaningful content of the data,
74             independent of textual representation. The data in these nodes cannot
75             be modified: different data requires new nodes.
76              
77             =item L
78              
79             This module supplies functions concerned with the creation, examination,
80             and other manipulation of XML data nodes (content chunks and elements).
81             The nodes are dumb data objects, best manipulated using plain functions
82             such as the ones in this module.
83              
84             =item L
85              
86             This module supplies Perl regular expressions describing the grammar of
87             XML 1.0. This is intended to support doing irregular things with XML,
88             rather than for normal parsing.
89              
90             =item L
91              
92             This module supplies functions that parse and serialise XML data as text
93             according to the XML 1.0 specification.
94              
95             =back
96              
97             =head1 OTHER DISTRIBUTIONS
98              
99             Other CPAN distributions that work with L are:
100              
101             =over
102              
103             =item L
104              
105             A testing tool, providing L-style functions that check
106             whether XML nodes are as expected.
107              
108             =item L
109              
110             Provides a way to construct XML data nodes by procedural code.
111             Some programmers will find this more comfortable than the functional
112             style offered by L.
113              
114             =item L
115              
116             Helps to parse things that are encoded in XML in common ways.
117              
118             =item C
119              
120             This namespace exists to contain modules that perform transformations
121             on XML documents, or parts thereof, in the form of L
122             and L nodes.
123              
124             =back
125              
126             =cut
127              
128             package XML::Easy;
129              
130 3     3   933417 { use 5.010001; }
  3         15  
131 3     3   26 use warnings;
  3         6  
  3         232  
132 3     3   22 use strict;
  3         5  
  3         213  
133              
134             our $VERSION = "0.014";
135              
136 3     3   417 use parent "Exporter";
  3         403  
  3         24  
137             our @EXPORT_OK = qw(
138             xml10_read_content xml10_read_element
139             xml10_read_document xml10_read_extparsedent
140             xml10_write_content xml10_write_element
141             xml10_write_document xml10_write_extparsedent
142             );
143              
144             require XML::Easy::Text;
145             XML::Easy::Text->VERSION($VERSION);
146             XML::Easy::Text->import(@EXPORT_OK);
147              
148             =head1 SEE ALSO
149              
150             L,
151             L,
152             L,
153             L,
154             L
155              
156             =head1 AUTHOR
157              
158             Andrew Main (Zefram) (deceased March 10 2025)
159              
160             =head2 Maintainer
161              
162             James E Keenan (jkeenan@cpan.org), beginning with version 0.012
163              
164             =head1 COPYRIGHT
165              
166             Copyright (C) 2008, 2009 PhotoBox Ltd
167              
168             Copyright (C) 2009, 2010, 2011, 2017
169             Andrew Main (Zefram)
170              
171             =head1 LICENSE
172              
173             This module is free software; you can redistribute it and/or modify it
174             under the same terms as Perl itself.
175              
176             =cut
177              
178             1;