line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package RDF::RDFa::Linter::Error; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
20
|
use 5.008; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
4
|
1
|
|
|
1
|
|
5
|
use base qw(RDF::RDFa::Generator::HTML::Pretty::Note); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
1147
|
|
5
|
|
|
|
|
|
|
use strict; |
6
|
|
|
|
|
|
|
use constant XHTML_NS => 'http://www.w3.org/1999/xhtml'; |
7
|
|
|
|
|
|
|
use XML::LibXML qw(:all); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.053'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new |
12
|
|
|
|
|
|
|
{ |
13
|
|
|
|
|
|
|
my ($class, %self) = @_; |
14
|
|
|
|
|
|
|
return bless \%self, $class; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub node |
18
|
|
|
|
|
|
|
{ |
19
|
|
|
|
|
|
|
my ($self, $namespace, $element) = @_; |
20
|
|
|
|
|
|
|
die "unknown namespace" unless $namespace eq XHTML_NS; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my $node = XML::LibXML::Element->new($element); |
23
|
|
|
|
|
|
|
$node->setNamespace($namespace, undef, 1); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my @categories = qw(Notice Notice Warning Warning Error Error); |
26
|
|
|
|
|
|
|
my $b = $node->addNewChild($namespace, 'b'); |
27
|
|
|
|
|
|
|
$b->appendTextNode($categories[$self->{'level'}].': '); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
$node->appendTextNode($self->{'text'}); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
if ($self->{'link'}) |
32
|
|
|
|
|
|
|
{ |
33
|
|
|
|
|
|
|
$node->appendTextNode(' ['); |
34
|
|
|
|
|
|
|
my $a = $node->addNewChild($namespace, 'a'); |
35
|
|
|
|
|
|
|
$a->setAttribute( href => $self->{'link'} ); |
36
|
|
|
|
|
|
|
$a->appendTextNode('more info'); |
37
|
|
|
|
|
|
|
$node->appendTextNode(']'); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
return $node; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |