line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Microformat::Element::rel_tag; |
2
|
3
|
|
|
3
|
|
5160
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
91
|
|
3
|
3
|
|
|
3
|
|
15
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
455
|
|
4
|
3
|
|
|
3
|
|
14
|
use base 'Text::Microformat::Element'; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
1740
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
__PACKAGE__->_init({ |
7
|
|
|
|
|
|
|
criteria => { |
8
|
|
|
|
|
|
|
rel => 'tag', |
9
|
|
|
|
|
|
|
}, |
10
|
|
|
|
|
|
|
}); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub MachineValue { |
13
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
14
|
0
|
0
|
|
|
|
|
my $tag = defined $self->_element->local_name ? $self->_element->local_name : ""; |
15
|
0
|
0
|
|
|
|
|
if ($tag eq 'a') { |
16
|
0
|
|
|
|
|
|
return $self->_element->attr('href'); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
else { |
19
|
0
|
|
|
|
|
|
return undef; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 NAME |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Text::Microformat::Element::rel_tag - a rel-tag element |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 SYNOPSIS |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
To add rel-tag to a Text::Microformat schema: |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
package Text::Microformat::Element::hMyFormat |
32
|
|
|
|
|
|
|
__PACKAGE__->init( |
33
|
|
|
|
|
|
|
'my-format', |
34
|
|
|
|
|
|
|
schema => { |
35
|
|
|
|
|
|
|
tags => 'rel-tag', |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
To then retrieve tags from a Text::Microformat::Element::hMyFormat instance: |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
foreach my $tag (@{$format->tags}) { |
42
|
|
|
|
|
|
|
print $tag->MachineValue, "\n"; # print the href |
43
|
|
|
|
|
|
|
print $tag->HumanValue, "\n"; # print the tag word |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 SEE ALSO |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
L, L |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 AUTHOR |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Keith Grennan, C<< >> |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 BUGS |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Log bugs and feature requests here: L |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 SUPPORT |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Project homepage: L |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Copyright 2007 Keith Grennan, all rights reserved. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
67
|
|
|
|
|
|
|
under the same terms as Perl itself. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=cut |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
1; |