blib/lib/XML/Lenient.pm

filter: Statementstmt 100% 175 / 175 Branchbran 68.0% 68 / 100 Conditioncond 88.8% 8 / 9 MC/DCmcdc 83.3% 5 / 6 Subroutinesub 100% 23 / 23 Podpod n/a totaltotal 89.1% 279 / 313 CC 60 SCAR 19.8
CC
60
Cov
88%
_buildstack
12.4
within
10.2
_restoreverbatim
9.3
CRAP 7.3
↑ Summary
1 package XML::Lenient;
2 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 ▶use Method::Signatures;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 6 our $VERSION = '1.0.0'; #See www.semver.org
8  
9 has verbatim => (
10 is => 'rw',
11 6 ▶ default => sub{['applet',
Subroutine __ANON__: called CC=1 SCAR=0.0
12 'code',
13 'pre',
14 'script']},
15 6 );
16  
17 6 has tagl => (
18 is => 'rw',
19 default => '<',
20 );
21  
22 6 has tagr => (
23 is => 'rw',
24 default => '>',
25 );
26  
27 6 has tagc => (
28 is => 'rw',
29 default => '/',
30 );
31  
32 6 ▶method within($full, $tag, $n = 1) {
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine within: called CC=10 SCAR=23.2
Branch: 4 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 82 82
unless scalar @_ > 1 0 82 82
scalar @_ > 2 ? : 50 32 82
if scalar @_ > 3 0 82 82
33 82 ▶ if (!defined $tag or 0 == length($tag)) {
Branch: 1 branch
BranchTrueFalseTotal
if (not defined $tag or 0 == length $tag) { } 2 80 82
Condition100%3/3
not defined $tag or 0 == length $tag
l!l&&r!l&&!r
1180
MC/DC100%2/2
not defined $tag or 0 == length $tag
not defined $tag 0 == length $tag
Truth table100%3/3
not(A) or B
A= not defined $tagB= 0 == length $tag
ABresult
1X1
011
000
34 2 return '';
35 } else {
36 80 my @vtagged;
37 80 $self->_stripverbatim(\@vtagged, \$full);
38 80 my $left = $self->{tagl} . $tag . '[ ' . $self->{tagr} . ']';
39 80 ▶ my $count = () = $full =~ /$left/g if defined $full;
Branch: 1 branch
BranchTrueFalseTotal
if defined $full 80 0 80
40 80 my $wanted = '';
41 80 _tidyindex(\$n);
42 80 my @stack;
43 80 $self->_buildstack(\@stack, $full, $tag);
44 80 ▶ if ($n <= $#stack) {
Branch: 1 branch
BranchTrueFalseTotal
if ($n <= $#stack) 77 3 80
45 77 ▶ $wanted = substr($full, $stack[$n][0], $stack[$n][1] - $stack[$n][0]) if scalar @stack;
Branch: 1 branch
BranchTrueFalseTotal
if scalar @stack 77 0 77
46 77 $self->_restoreverbatim(\@vtagged, \$wanted);
47 }
48 80 return $wanted;
49 }
50 }
51  
52 6 ▶func _tidyindex($refn) {
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine _tidyindex: called CC=7 SCAR=19.5
Branch: 2 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 84 84
if scalar @_ > 1 0 84 84
53 84 ▶ $$refn =~ s/[^-0-9]//g if defined $$refn;
Branch: 1 branch
BranchTrueFalseTotal
if defined $$refn 68 16 84
54 84 ▶ $$refn = 1 unless defined $$refn;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $$refn 16 68 84
55 84 ▶ $$refn = 1 if 0 == length($$refn);
Branch: 1 branch
BranchTrueFalseTotal
if 0 == length $$refn 2 82 84
56 84 my $right = substr($$refn, 1);
57 84 $right =~ s/-//g;
58 84 $$refn = substr($$refn, 0, 1) . $right;
59 84 ▶ $$refn-- unless $$refn < 1;
Branch: 1 branch
BranchTrueFalseTotal
unless $$refn < 1 79 5 84
60 }
61  
62 6 ▶method _buildstack($refstack, $full, $tag) {
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine _buildstack: called CC=12 SCAR=25.2
Branch: 4 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 86 86
unless scalar @_ > 1 0 86 86
unless scalar @_ > 2 0 86 86
if scalar @_ > 3 0 86 86
63 my $regex = '((?:' . $self->{tagl}
64 . $self->{tagc} . '?' . $tag . ') *?.*?'
65 86 . $self->{tagr} . ')';
66 86 ▶ if (defined $full) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $full) 86 0 86
67 86 ▶ while ($full =~ m/$regex/gi) {
Branch: 1 branch
BranchTrueFalseTotal
if ($full =~ /$regex/gi) 395 86 481
68 395 ▶ if ($self->{tagl} . $self->{tagc} . $tag . $self->{tagr} eq $1) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'tagl'} . $self->{'tagc'} . $tag . $self->{'tagr'} eq $1) { } 189 206 395
69 189 ▶ for (my $idx = $#$refstack; 0 <= $idx; $idx--) {
Branch: 1 branch
BranchTrueFalseTotal
if (0 <= $idx) 252 0 252
70 252 ▶ if (!defined $$refstack[$idx][1]) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $refstack->[$idx][1]) 189 63 252
71 189 $$refstack[$idx][1] = pos($full) - length($1);
72 189 last;
73 }
74 }
75 } else {
76 206 push @$refstack, [pos($full), undef];
77 }
78 }
79 }
80 86 for my $lineref (@$refstack) {
81 206 ▶ if (!defined $$lineref[1]) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $lineref->[1]) 17 189 206
82 17 $$lineref[1] = length($full);
83 }
84 }
85 }
86  
87 6 ▶method _restoreverbatim($refvtagged, $reftext) {
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine _restoreverbatim: called CC=9 SCAR=22.3
Branch: 3 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 77 77
unless scalar @_ > 1 0 77 77
if scalar @_ > 2 0 77 77
88 77 for my $vtag(@{$self->{verbatim}}) {
89 308 my $lv = $self->{tagl} . $vtag . $self->{tagr};
90 308 my $rv = $self->{tagl} . $self->{tagc} . $vtag . $self->{tagr};
91 308 my $regex = $lv . '(\d+?)' . $rv; #Should be impossible for a D to appear.
92 308 my @local;
93 308 ▶ if (scalar @$refvtagged and defined $$reftext) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @$refvtagged and defined $$reftext) 12 296 308
Condition66%2/3
scalar @$refvtagged and defined $$reftext
!ll&&!rl&&r
296012
MC/DC50%1/2
scalar @$refvtagged and defined $$reftext
scalar @$refvtagged defined $$reftext
Truth table66%2/3
A and B
A= scalar @$refvtaggedB= defined $$reftext
ABresult
0X0
100
111
94 12 @local = $$reftext =~ /$regex/g;
95 }
96 308 for my $idx (@local) {
97 1 ▶ if (defined $$refvtagged[$idx]) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $refvtagged->[$idx]) 1 0 1
98 1 $regex = $lv . $idx . $rv;
99 1 $$reftext =~ s/$regex/$$refvtagged[$idx]/;
100 1 $$refvtagged[$idx] = undef;
101 }
102 }
103 }
104 }
105  
106 6 ▶method _stripverbatim($refvtagged, $reffull) {
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine _stripverbatim: called CC=8 SCAR=21.0
Branch: 3 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 81 81
unless scalar @_ > 1 0 81 81
if scalar @_ > 2 0 81 81
107 81 for my $vtag(@{$self->{verbatim}}) {
108 324 my $lv = $self->{tagl} . $vtag . '(?: |' . $self->{tagr} . ')';
109 324 my $rv = $self->{tagl} . $self->{tagc} . $vtag . $self->{tagr};
110 324 my $regex = $lv . '.+?' . $rv;
111 324 my $nbase = scalar @$refvtagged;
112 324 my @local;
113 324 ▶ @local = $$reffull =~ /($regex)/gmsi if defined $$reffull;
Branch: 1 branch
BranchTrueFalseTotal
if defined $$reffull 324 0 324
114 324 push @$refvtagged, @local;
115 324 ▶ if (-1 < $#$refvtagged) {
Branch: 1 branch
BranchTrueFalseTotal
if (-1 < $refvtagged->$#*) 10 314 324
116 10 for my $n($nbase..$#$refvtagged) {
117 5 my $rplc = $self->{tagl} . $vtag . $self->{tagr} . $n . $rv;
118 5 $$reffull =~ s/$$refvtagged[$n]/$rplc/ms;
119 }
120 }
121 }
122 }
123  
124 6 ▶method innertext($full) {
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine innertext: called CC=4 SCAR=13.9
Branch: 2 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 25 25
if scalar @_ > 1 0 25 25
125 25 ▶ if ($self->{tagl} ne substr($full, 0, length($self->{tagl}))) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'tagl'} ne substr($full, 0, length $self->{'tagl'})) { } 8 17 25
126 8 return $full;
127 } else {
128 17 my $regex = '^' . $self->{tagl} . '(.+?)(?: |' . $self->{tagr} . ')';
129 17 my ($tag) = $full =~ m/$regex/i;
130 17 return $self->innertext($self->within($full, $tag));
131 }
132 }
133  
134 6 ▶method tagval($full, $tag, $n = 1) {
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine tagval: called CC=8 SCAR=20.8
Branch: 4 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 6 6
unless scalar @_ > 1 0 6 6
scalar @_ > 2 ? : 2 4 6
if scalar @_ > 3 0 6 6
135 6 ▶ if (!defined $tag or 0 == length($tag)) {
Branch: 1 branch
BranchTrueFalseTotal
if (not defined $tag or 0 == length $tag) { } 2 4 6
Condition100%3/3
not defined $tag or 0 == length $tag
l!l&&r!l&&!r
114
MC/DC100%2/2
not defined $tag or 0 == length $tag
not defined $tag 0 == length $tag
Truth table100%3/3
not(A) or B
A= not defined $tagB= 0 == length $tag
ABresult
1X1
011
000
136 2 return '';
137 } else {
138 4 my @stack;
139 4 $self->_buildstack(\@stack, $full, $tag);
140 4 _tidyindex(\$n);
141 4 my $end = $stack[$n][0];
142 4 ▶ if (defined $end) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $end) { } 3 1 4
143 3 my $ltag = $self->{tagl} . $tag . ' ';
144 3 my $start = index($full, $ltag) + length($ltag);
145 3 my $subml = substr($full, $start, $end - $start);
146 3 my $tagval = substr($full, $start, $end - $start - length($self->{tagr}));
147 3 return $tagval;
148 } else {
149 1 return '';
150 }
151 }
152 }
153  
154 6 ▶method wpath($full, $path) {
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine wpath: called CC=6 SCAR=18.1
Branch: 3 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 9 9
unless scalar @_ > 1 0 9 9
if scalar @_ > 2 0 9 9
155 9 my @steps = split(/\//, $path);
156 9 for (@steps) {
157 42 my ($tag, $idx) = split(/\[/, $_);
158 42 ▶ $full = $self->within($full, $tag, $idx) if defined $tag;
Branch: 1 branch
BranchTrueFalseTotal
if defined $tag 39 3 42
159 }
160 9 return $full;
161 }
162  
163 6 ▶method tagcount($full, $tag) {
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine tagcount: called CC=4 SCAR=14.1
Branch: 3 branches
BranchTrueFalseTotal
unless scalar @_ > 0 0 2 2
unless scalar @_ > 1 0 2 2
if scalar @_ > 2 0 2 2
164 2 my @stack;
165 2 $self->_buildstack(\@stack, $full, $tag);
166 2 return scalar @stack;
167 }
168  
169 =pod
170  
171 =head1 NAME
172  
173 XML::Lenient - extracts strings from HTML, XML and similarly tagged text.
174  
175 =head1 SYNOPSIS
176  
177 use XML::Lenient;
178 my $p = XML::Lenient->new(); #This is the same as:
179 my $p = XML::Lenient->new(
180 tagl => '<',
181 tagr => '>',
182 tagc => '/',
183 verbatim => ['applet', 'code', 'pre', 'script']
184 );
185 my $subtext = $p->within($ml, $tag, $index);
186 $subtext = $p->innertext($ml);
187 $subtext = $p->wpath($ml, $path);
188 my $tagvalue = $p->tagval($ml, $tag, $index);
189 my $count = $p->tagcount($ml, $tag);
190  
191 =head1 DESCRIPTION
192  
193 =head2 What
194  
195 XML::Lenient is meant to parse markup languages such as HTML and
196 XML in the knowledge that someone, somewhere, is going to break
197 every rule in the book. It will handle malformed XML, wrongly
198 nested HTML tags and everything else that I have thrown at it.
199 The results may not be what the author of the mistake expected,
200 but that's their headache.
201  
202 =head2 Why
203  
204 My original intent when writing it was to enable me to write
205 tests when developing code that generates HTML. I want to be
206 able to change any aspect of the HTML without breaking every
207 test previously written. I could find no way of doing this with
208 existing tools, so I wrote this. It is based on a module I
209 wrote for Excel in VBA that I use for web scraping.
210  
211 =head2 How
212  
213 All methods take a string and return a string (an integer in one
214 case). There are no complicated data structures.
215  
216 =head3 The object
217  
218 my $p = XML::Lenient->new();
219  
220 For most cases, the defaults will be all you need.
221 You could specify the version below, but it merely applies the
222 defaults. However, it shows how to specify the properties
223 should you have a need.
224  
225 my $p = XML::Lenient->new(
226 tagl => '<',
227 tagr => '>',
228 tagc => '/',
229 verbatim => ['applet', 'code', 'pre', 'script']
230 );
231  
232 The parser object has four properties. Three of these describe
233 how a tag appears.
234  
235 Property Default Meaning
236 tagl < The leftmost character(s) of a tag
237 tagr > The rightmost character(s) of a tag
238 tagc / The character(s) indicating a closing tag
239  
240 While the code has been written to handle multiple characters
241 in each delimiter, I know of no use case for this and have
242 written no tests. I do know that
243 L<Template::Toolkit|http://search.cpan.org/~abw/Template-Toolkit-2.26/lib/Template/Toolkit.pod>
244 uses two character delimiters but cannot see a situation in
245 which it would constitute tag delimited text.
246  
247 The fourth property is an array of "verbatim" tags. Data within
248 such tags will not be treated as tags. If you want to use this
249 parser on data within verbatim tags, create a parser object
250 without the verbatim tag(s) that are the problem. There is
251 nothing to prevent you having two parser objects with different
252 properties and using the right one for each task.
253  
254 =head3 within
255  
256 $p->within($ml, $tag, $index);
257  
258 within returns the text between an opening tag and a closing
259 tag. So:
260  
261 my $p = XML::Lenient->new();
262 my $ml = '<x>asdf</x>';
263 my $within = $p->within($ml, 'x');
264 ok ('asdf' eq $within, "Simple within works");
265  
266 The index is optional and defaults to 1 (the first occurrence
267 of the tag). This is done to retain compatibility with Xpath
268 specs so that the "wpath" method, described later, can accept
269 valid xpaths without modification. It is the appearance of the
270 opening tag that is counted; nesting is ignored. So:
271  
272 $ml = '<x><x><x>asdf</x></x></x><x>qwer</x>';
273 $within = $p->within($ml, 'x', 2);
274 ok ('<x>asdf</x>' eq $within, "Indexing works with nested tags");
275  
276 If an index is given that is higher than can be found, a zero
277 length string will be returned. An index of zero (or undef or a
278 zero length string) will return the first item. Negative
279 indices work in the same was as in Perl generally, -1
280 indicating the last opening tag found and other negative
281 numbers counting backwards. So:
282  
283 $ml = '<x><x><x>asdf</x></x></x><x>qwer</x>';
284 $within = $p->within($ml, 'x', 0);
285 ok ('<x><x>asdf</x></x>' eq $within,
286 "Zero index is the first element");
287 $within = $p->within($ml, 'x', -1);
288 ok ('qwer' eq $within,
289 "Negative index works as in Perl");
290 $within = $p->within($ml, 'x', -2);
291 ok ('asdf' eq $within,
292 "Negative indices continue working backwards");
293  
294 Extraneous tags are ignored whether they are matched properly:
295  
296 $ml = '<x><y><z>asdf</z></y></x>';
297 $within = $p->within($ml, 'z');
298 ok ('asdf' eq $within, 'Outer non-target tags ignored');
299  
300 or mismatched:
301  
302 $ml = '<x><y>asdf</x></y>';
303 $within = $p->within($ml, 'x');
304 ok ('<y>asdf' eq $within, "Mismatched tags return something sensible");
305 $within = $p->within($ml, 'y');
306 ok ('asdf</x>' eq $within,
307 "Mismatched tags return something sensible again");
308  
309 An unclosed tag is considered to be closed implicitly at the end
310 of the data. With nested unmatched tags, the closing tag(s) are
311 allocated to the innermost open tag first. So:
312  
313 $ml = '<x><x>asdf</x>';
314 $within = $p->within($ml, 'x');
315 ok ('<x>asdf</x>' eq $within, "Handles unclosed tags");
316  
317 =head3 wpath
318  
319 $subtext = $p->wpath($ml, $path);
320  
321 This is a wrapper around within that allows a path to be
322 specified in Xpath format. A valid xpath that uses no
323 indexing is always a valid wpath. But wpath is far more Lenient
324 and will accept the omission of any step in the path that is
325 not required to identify the wanted text. Indeed, wpath will be
326 faster if such steps are omitted. So, with 80 lines of HTML I
327 sha'n't repeat here:
328  
329 my $text = $p->wpath($ml,
330 '/html/body/div/div/div/table[1]/tbody/tr[2]/td[2]');
331 ok('17' eq $text, "Full xpath works");
332 $text = $p->wpath($ml, 'tbody/tr[2]/td[2]');
333 ok('17' eq $text, "Abbreviated wpath works");
334  
335 Both variants work with the second being faster. If you know
336 there are no <tr> tags in the table header (there are in the
337 test HTML), the tbody could be omitted, too. Since each step
338 in a path is split using the '[' character and non-numeric
339 characters deleted, it is perfectly acceptable in a wpath to
340 omit the closing ']'. Indeed, the Lenient approach means you
341 can do some spectacularly improper things to the wpath and it
342 will still work. Just don't tell anyone I advised it.
343  
344 An xpath that uses an index will differ from a wpath if and
345 only if the tag is repeated both at the same nesting level
346 and at a deeper nesting level before the tag that xpath would
347 select. So:
348  
349 my $ml = '<a><a>asdf</a><a>qwer</a>';
350
351 Using a[2], xpath would return qwer while wpath would return
352 asdf.
353  
354 Indices work as they do using within. An index with no numeric
355 characters is treated as 1, i.e. the first element. Zero is
356 also treated as being the first element. An index of undef is
357 changed to 1.
358  
359 =head3 tagval
360  
361 $p->tagval($ml, $tag, $index);
362  
363 I have never needed this, but I can envisage doing so. tagval
364 returns the attributes inside a tag as opposed to the data
365 between an opening and closing tag. So:
366  
367 my $ml = '<a href="www.example.com">Click</a>';
368 my $val = $p->tagval($ml, 'a');
369 ok ('href="www.example.com"' eq $val, 'Simple tagval works');
370 $within = $p->within($ml, 'a');
371 ok ('Click' eq $within, "Within tags with values works");
372  
373 As for 'within', the index is optional and defaults to 1.
374  
375 =head3 innertext
376  
377 $p->innertext($ml);
378  
379 This is something I need when scraping web pages that change
380 their format without warning. Provided I have some pointers
381 to the data, innertext will return the text from within any
382 tags it may find, starting at the first non-tag character. So:
383  
384 $ml = '<x><x><x><x>asdf</x></x></x></x>';
385 $inner = $p->innertext($ml);
386 ok('asdf' eq $inner, 'Tags 4 deep works');
387 $ml = '<x>asdf<x><x><x>asdf</x></x></x></x>';
388 $inner = $p->innertext($ml);
389 ok('asdf<x><x><x>asdf</x></x></x>' eq $inner,
390 'Deep tags returned after text starts');
391  
392 Provided there is no text between the leading tags, mismatched
393 tags will not cause problems:
394  
395 $ml = '<x><y>asdf</x></y>';
396 $inner = $p->innertext($ml);
397 ok('asdf' eq $inner, 'Magic happens to mismatched tags');
398  
399 =head3 tagcount
400  
401 my $count = $p->tagcount($ml, $tag);
402  
403 Returns the number of opening target tags in $ml or zero if it
404 doesn't exist. This is the exception that returns an integer
405 rather than a string.
406  
407 my $ml = '<div><div><div><div>asdf</div></div></div></div>';
408 my $n = $p->tagcount($ml, 'div');
409 ok (4 == $n, 'Correct number of div tags');
410 $n = $p->tagcount($ml, 'x');
411 ok (0 == $n, 'Correct number of x tags');
412  
413 =head1 LIMITATIONS
414  
415 XML::Lenient cannot handle more text than will fit in memory.
416  
417 Tags cannot be split over more than one line (but having
418 the opening and closing tags on different lines is fine). If
419 you have split tags, a possible workaround is to change
420 carriage returns and line feeds to spaces before passing the
421 string to the parser.
422  
423 Neither YAML nor JSON can be handled.
424  
425 Internally, XML::Lenient uses lots of regexes (and other things as
426 well. I know regexes alone aren't enough). I have NOT tried to
427 prevent users from writing regex-style elements in tags, but I
428 dread to think what will happen if someone tries. By all means
429 try, though. And may your God go with you.
430  
431 =head1 PRESENTATION VIDEO
432  
433 I presented this to the London Perl Mongers on 2016-04-21.
434 There is a YouTube video at L<https://www.youtube.com/watch?v=3d_pkd4OkHQ&index=6&list=PL9L8-lcxZ4z0yP0jRd_7HCygBblDbXNO5>.
435  
436 =head1 AUTHOR
437  
438 John Davies
439  
440 =head1 MODULES USED
441  
442 L<Moo|http://search.cpan.org/~haarg/Moo-2.001001/lib/Moo.pm>
443  
444 L<Method::Signatures|http://search.cpan.org/~barefoot/Method-Signatures-20160315/lib/Method/Signatures.pm>
445  
446 =head1 SEE ALSO
447  
448 I tried - and had problems with - several modules. I may be
449 the problem. But I tried:
450  
451 L<HTML::Parser|http://search.cpan.org/dist/HTML-Parser/Parser.pm>
452  
453 L<HTML::TreeBuilder|http://search.cpan.org/~cjm/HTML-Tree-5.03/lib/HTML/TreeBuilder.pm>
454  
455 L<HTML::Element|http://search.cpan.org/~cjm/HTML-Tree-5.03/lib/HTML/Element.pm>
456  
457 L<XML::Xpath|http://search.cpan.org/~msergeant/XML-XPath-1.13/XPath.pm>
458  
459 L<XML::LibXML|http://search.cpan.org/dist/XML-LibXML/LibXML.pod>
460  
461 and they may be better for you than this.
462  
463 =head1 VERSION
464  
465 1.0.0. See L<http://www.semver.org>.
466  
467 =head1 COPYRIGHT
468  
469 Copyright (c) 2016, John Davies. All rights reserved.
470  
471 =head1 LICENCE
472  
473 This module is free software; you can redistribute it and/or
474 modify it under the same terms as Perl itself.
475  
476 =cut
477  
478 6 1;
↑ Summary