line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package XML::Liberal::Remedy::StandaloneAttribute; |
2
|
2
|
|
|
2
|
|
1016
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
68
|
|
3
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
9
|
use List::Util qw( min ); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
319
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub apply { |
7
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
8
|
0
|
|
|
|
|
|
my($driver, $error, $xml_ref) = @_; |
9
|
|
|
|
|
|
|
|
10
|
0
|
0
|
|
|
|
|
my ($attr) = $error->message =~ |
11
|
|
|
|
|
|
|
/^parser error : Specification mandate value for attribute (\w+)/ |
12
|
|
|
|
|
|
|
or return 0; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# In input like " ", the error location points to the slash |
15
|
|
|
|
|
|
|
# -- the first non-whitespace character after the attribute name. We |
16
|
|
|
|
|
|
|
# can just insert an attribute value at that point; no need to look |
17
|
|
|
|
|
|
|
# backwards for where the attribute name starts or ends. |
18
|
0
|
|
|
|
|
|
substr $$xml_ref, $error->location, 0, qq[="$attr" ]; |
19
|
0
|
|
|
|
|
|
return 1; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1; |