| 1 | package XML::Tiny::DOM; | ||
| 2 | |||
| 3 | 3 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 3 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 3 | ▶ | use vars qw($VERSION); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 3 | $VERSION = '1.1'; | |
| 9 | |||
| 10 | 3 | ▶ | use XML::Tiny; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 3 | ▶ | use XML::Tiny::DOM::Element; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 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<XML::Tiny>'s C<parsefile> 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 | 2 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||
| 41 | 2 | shift; | |
| 42 | 2 | 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<http://rt.cpan.org/> 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<XML::Tiny> | ||
| 63 | |||
| 64 | L<XML::Tiny::DOM::Element> | ||
| 65 | |||
| 66 | =head1 AUTHOR, COPYRIGHT and LICENCE | ||
| 67 | |||
| 68 | David Cantrell E<lt>F<david@cantrell.org.uk>E<gt> | ||
| 69 | |||
| 70 | Copyright 2009 David Cantrell E<lt>david@cantrell.org.ukE<gt> | ||
| 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 | 3 | '<one>zero</one>'; | |