File Coverage

blib/lib/XML/Tiny/DOM.pm
Criterion Covered Total %
statement 17 17 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 1 1 100.0
total 24 24 100.0


line stmt bran cond sub pod time code
1             package XML::Tiny::DOM;
2              
3 2     2   70876 use strict;
  2         6  
  2         83  
4 2     2   10 use warnings;
  2         4  
  2         62  
5              
6 2     2   12 use vars qw($VERSION);
  2         7  
  2         145  
7              
8             $VERSION = '1.1';
9              
10 2     2   1906 use XML::Tiny;
  2         3425  
  2         117  
11 2     2   1259 use XML::Tiny::DOM::Element;
  2         20  
  2         195  
12              
13             =head1 NAME
14              
15             XML::Tiny::DOM - wrapper for XML::Tiny to provide a DOMmish interface
16              
17             =head1 DESCRIPTION
18              
19             This is a small simple wrapper for XML::Tiny that makes it much easier
20             to access information in the data structures returned by XML::Tiny.
21              
22             =head1 SYNOPSIS
23              
24             use XML::Tiny::DOM;
25             my $document = XML::Tiny::DOM->new(...);
26              
27             =head1 METHODS
28              
29             =head2 new
30              
31             This is the constructor. It takes exactly the same parameters as
32             C's C function, but instead of returning a naked
33             and rather complex data structure, it returns a XML::Tiny::DOM::Element
34             object representing the root element of the document.
35              
36             There are no other methods.
37              
38             =cut
39              
40             sub new {
41 2     2 1 29 shift;
42 2         15 return XML::Tiny::DOM::Element->_new(XML::Tiny::parsefile(@_)->[0]);
43             }
44              
45             =head1 LIMITATIONS
46              
47             This module is subject to all the limitations of XML::Tiny. However,
48             no effort has been made to make this module work with perl versions
49             prior to 5.6.2.
50              
51             =head1 BUGS and FEEDBACK
52              
53             I welcome feedback about my code, including constructive criticism.
54             Bug reports should be made using L or by email,
55             and should include the smallest possible chunk of code, along with
56             any necessary XML data, which demonstrates the bug. Ideally, this
57             will be in the form of a file which I can drop in to the module's
58             test suite.
59              
60             =head1 SEE ALSO
61              
62             L
63              
64             L
65              
66             =head1 AUTHOR, COPYRIGHT and LICENCE
67              
68             David Cantrell EFE
69              
70             Copyright 2009 David Cantrell Edavid@cantrell.org.ukE
71              
72             This software is free-as-in-speech software, and may be used,
73             distributed, and modified under the terms of either the GNU
74             General Public Licence version 2 or the Artistic Licence. It's
75             up to you which one you use. The full text of the licences can
76             be found in the files GPL2.txt and ARTISTIC.txt, respectively.
77              
78             =head1 CONSPIRACY
79              
80             This module is also free-as-in-mason software.
81              
82             =cut
83              
84             'zero';