1270 |
|
|
1271 |
redo A; |
redo A; |
1272 |
} else { |
} else { |
1273 |
if ($self->{nc} == 0x003D) { # = |
if ($self->{nc} == 0x003D or $self->{nc} == 0x003C) { # =, < |
1274 |
!!!cp (93); |
!!!cp (93); |
1275 |
## XML5: Not a parse error. |
## XML5: Not a parse error. |
1276 |
!!!parse-error (type => 'bad attribute value'); |
!!!parse-error (type => 'bad attribute value'); |
1316 |
$self->{state} = ENTITY_STATE; |
$self->{state} = ENTITY_STATE; |
1317 |
!!!next-input-character; |
!!!next-input-character; |
1318 |
redo A; |
redo A; |
1319 |
|
} elsif ($self->{is_xml} and |
1320 |
|
$is_space->{$self->{nc}}) { |
1321 |
|
!!!cp (97.1); |
1322 |
|
$self->{ca}->{value} .= ' '; |
1323 |
|
## Stay in the state. |
1324 |
|
!!!next-input-character; |
1325 |
|
redo A; |
1326 |
} elsif ($self->{nc} == -1) { |
} elsif ($self->{nc} == -1) { |
1327 |
!!!parse-error (type => 'unclosed attribute value'); |
!!!parse-error (type => 'unclosed attribute value'); |
1328 |
if ($self->{ct}->{type} == START_TAG_TOKEN) { |
if ($self->{ct}->{type} == START_TAG_TOKEN) { |
1370 |
} |
} |
1371 |
$self->{ca}->{value} .= chr ($self->{nc}); |
$self->{ca}->{value} .= chr ($self->{nc}); |
1372 |
$self->{read_until}->($self->{ca}->{value}, |
$self->{read_until}->($self->{ca}->{value}, |
1373 |
q["&<], |
qq["&<\x09\x0C\x20], |
1374 |
length $self->{ca}->{value}); |
length $self->{ca}->{value}); |
1375 |
|
|
1376 |
## Stay in the state |
## Stay in the state |
1407 |
$self->{state} = ENTITY_STATE; |
$self->{state} = ENTITY_STATE; |
1408 |
!!!next-input-character; |
!!!next-input-character; |
1409 |
redo A; |
redo A; |
1410 |
|
} elsif ($self->{is_xml} and |
1411 |
|
$is_space->{$self->{nc}}) { |
1412 |
|
!!!cp (103.1); |
1413 |
|
$self->{ca}->{value} .= ' '; |
1414 |
|
## Stay in the state. |
1415 |
|
!!!next-input-character; |
1416 |
|
redo A; |
1417 |
} elsif ($self->{nc} == -1) { |
} elsif ($self->{nc} == -1) { |
1418 |
!!!parse-error (type => 'unclosed attribute value'); |
!!!parse-error (type => 'unclosed attribute value'); |
1419 |
if ($self->{ct}->{type} == START_TAG_TOKEN) { |
if ($self->{ct}->{type} == START_TAG_TOKEN) { |
1461 |
} |
} |
1462 |
$self->{ca}->{value} .= chr ($self->{nc}); |
$self->{ca}->{value} .= chr ($self->{nc}); |
1463 |
$self->{read_until}->($self->{ca}->{value}, |
$self->{read_until}->($self->{ca}->{value}, |
1464 |
q['&<], |
qq['&<\x09\x0C\x20], |
1465 |
length $self->{ca}->{value}); |
length $self->{ca}->{value}); |
1466 |
|
|
1467 |
## Stay in the state |
## Stay in the state |
1573 |
0x0022 => 1, # " |
0x0022 => 1, # " |
1574 |
0x0027 => 1, # ' |
0x0027 => 1, # ' |
1575 |
0x003D => 1, # = |
0x003D => 1, # = |
1576 |
|
0x003C => 1, # < |
1577 |
}->{$self->{nc}}) { |
}->{$self->{nc}}) { |
1578 |
!!!cp (115); |
!!!cp (115); |
1579 |
## XML5: Not a parse error. |
## XML5: Not a parse error. |
1583 |
} |
} |
1584 |
$self->{ca}->{value} .= chr ($self->{nc}); |
$self->{ca}->{value} .= chr ($self->{nc}); |
1585 |
$self->{read_until}->($self->{ca}->{value}, |
$self->{read_until}->($self->{ca}->{value}, |
1586 |
q["'=& >], |
qq["'=& \x09\x0C>], |
1587 |
length $self->{ca}->{value}); |
length $self->{ca}->{value}); |
1588 |
|
|
1589 |
## Stay in the state |
## Stay in the state |
3093 |
0x003C => 1, 0x0026 => 1, -1 => 1, # <, & |
0x003C => 1, 0x0026 => 1, -1 => 1, # <, & |
3094 |
$self->{entity_add} => 1, |
$self->{entity_add} => 1, |
3095 |
}->{$self->{nc}}) { |
}->{$self->{nc}}) { |
3096 |
!!!cp (1001); |
if ($self->{is_xml}) { |
3097 |
|
!!!cp (1001.1); |
3098 |
|
!!!parse-error (type => 'bare ero', |
3099 |
|
line => $self->{line_prev}, |
3100 |
|
column => $self->{column_prev} |
3101 |
|
+ ($self->{nc} == -1 ? 1 : 0)); |
3102 |
|
} else { |
3103 |
|
!!!cp (1001); |
3104 |
|
## No error |
3105 |
|
} |
3106 |
## Don't consume |
## Don't consume |
|
## No error |
|
3107 |
## Return nothing. |
## Return nothing. |
3108 |
# |
# |
3109 |
} elsif ($self->{nc} == 0x0023) { # # |
} elsif ($self->{nc} == 0x0023) { # # |
3112 |
$self->{kwd} = '#'; |
$self->{kwd} = '#'; |
3113 |
!!!next-input-character; |
!!!next-input-character; |
3114 |
redo A; |
redo A; |
3115 |
} elsif ((0x0041 <= $self->{nc} and |
} elsif ($self->{is_xml} or |
3116 |
|
(0x0041 <= $self->{nc} and |
3117 |
$self->{nc} <= 0x005A) or # A..Z |
$self->{nc} <= 0x005A) or # A..Z |
3118 |
(0x0061 <= $self->{nc} and |
(0x0061 <= $self->{nc} and |
3119 |
$self->{nc} <= 0x007A)) { # a..z |
$self->{nc} <= 0x007A)) { # a..z |
3232 |
my $code = $self->{kwd}; |
my $code = $self->{kwd}; |
3233 |
my $l = $self->{line_prev}; |
my $l = $self->{line_prev}; |
3234 |
my $c = $self->{column_prev}; |
my $c = $self->{column_prev}; |
3235 |
if ($charref_map->{$code}) { |
if ((not $self->{is_xml} and $charref_map->{$code}) or |
3236 |
|
($self->{is_xml} and 0xD800 <= $code and $code <= 0xDFFF) or |
3237 |
|
($self->{is_xml} and $code == 0x0000)) { |
3238 |
!!!cp (1015); |
!!!cp (1015); |
3239 |
!!!parse-error (type => 'invalid character reference', |
!!!parse-error (type => 'invalid character reference', |
3240 |
text => (sprintf 'U+%04X', $code), |
text => (sprintf 'U+%04X', $code), |
3347 |
my $code = $self->{kwd}; |
my $code = $self->{kwd}; |
3348 |
my $l = $self->{line_prev}; |
my $l = $self->{line_prev}; |
3349 |
my $c = $self->{column_prev}; |
my $c = $self->{column_prev}; |
3350 |
if ($charref_map->{$code}) { |
if ((not $self->{is_xml} and $charref_map->{$code}) or |
3351 |
|
($self->{is_xml} and 0xD800 <= $code and $code <= 0xDFFF) or |
3352 |
|
($self->{is_xml} and $code == 0x0000)) { |
3353 |
!!!cp (1008); |
!!!cp (1008); |
3354 |
!!!parse-error (type => 'invalid character reference', |
!!!parse-error (type => 'invalid character reference', |
3355 |
text => (sprintf 'U+%04X', $code), |
text => (sprintf 'U+%04X', $code), |
3389 |
$self->{nc} <= 0x007A) or # z |
$self->{nc} <= 0x007A) or # z |
3390 |
(0x0030 <= $self->{nc} and # 0 |
(0x0030 <= $self->{nc} and # 0 |
3391 |
$self->{nc} <= 0x0039) or # 9 |
$self->{nc} <= 0x0039) or # 9 |
3392 |
$self->{nc} == 0x003B) { # ; |
$self->{nc} == 0x003B or # ; |
3393 |
|
($self->{is_xml} and |
3394 |
|
not ($is_space->{$self->{nc}} or |
3395 |
|
{ |
3396 |
|
0x003C => 1, 0x0026 => 1, -1 => 1, # <, & |
3397 |
|
$self->{entity_add} => 1, |
3398 |
|
}->{$self->{nc}}))) { |
3399 |
our $EntityChar; |
our $EntityChar; |
3400 |
$self->{kwd} .= chr $self->{nc}; |
$self->{kwd} .= chr $self->{nc}; |
3401 |
if (defined $EntityChar->{$self->{kwd}} or |
if (defined $EntityChar->{$self->{kwd}} or |
3678 |
## XML5: Not defined yet. |
## XML5: Not defined yet. |
3679 |
|
|
3680 |
## TODO: |
## TODO: |
3681 |
|
|
3682 |
|
if (not $self->{stop_processing} and |
3683 |
|
not $self->{document}->xml_standalone) { |
3684 |
|
!!!parse-error (type => 'stop processing', ## TODO: type |
3685 |
|
level => $self->{level}->{info}); |
3686 |
|
$self->{stop_processing} = 1; |
3687 |
|
} |
3688 |
|
|
3689 |
!!!next-input-character; |
!!!next-input-character; |
3690 |
redo A; |
redo A; |
3691 |
} elsif ($self->{nc} == 0x005D) { # ] |
} elsif ($self->{nc} == 0x005D) { # ] |
3920 |
} |
} |
3921 |
$self->{ct} = {type => ELEMENT_TOKEN, name => '', |
$self->{ct} = {type => ELEMENT_TOKEN, name => '', |
3922 |
line => $self->{line_prev}, |
line => $self->{line_prev}, |
3923 |
column => $self->{column_prev} - 6}; |
column => $self->{column_prev} - 7}; |
3924 |
$self->{state} = DOCTYPE_MD_STATE; |
$self->{state} = DOCTYPE_MD_STATE; |
3925 |
!!!next-input-character; |
!!!next-input-character; |
3926 |
redo A; |
redo A; |
3968 |
$self->{ct} = {type => ATTLIST_TOKEN, name => '', |
$self->{ct} = {type => ATTLIST_TOKEN, name => '', |
3969 |
attrdefs => [], |
attrdefs => [], |
3970 |
line => $self->{line_prev}, |
line => $self->{line_prev}, |
3971 |
column => $self->{column_prev} - 6}; |
column => $self->{column_prev} - 7}; |
3972 |
$self->{state} = DOCTYPE_MD_STATE; |
$self->{state} = DOCTYPE_MD_STATE; |
3973 |
!!!next-input-character; |
!!!next-input-character; |
3974 |
redo A; |
redo A; |
4017 |
} |
} |
4018 |
$self->{ct} = {type => NOTATION_TOKEN, name => '', |
$self->{ct} = {type => NOTATION_TOKEN, name => '', |
4019 |
line => $self->{line_prev}, |
line => $self->{line_prev}, |
4020 |
column => $self->{column_prev} - 6}; |
column => $self->{column_prev} - 8}; |
4021 |
$self->{state} = DOCTYPE_MD_STATE; |
$self->{state} = DOCTYPE_MD_STATE; |
4022 |
!!!next-input-character; |
!!!next-input-character; |
4023 |
redo A; |
redo A; |
4819 |
redo A; |
redo A; |
4820 |
} |
} |
4821 |
} elsif ($self->{state} == ENTITY_VALUE_ENTITY_STATE) { |
} elsif ($self->{state} == ENTITY_VALUE_ENTITY_STATE) { |
|
## TODO: XMLize |
|
|
|
|
4822 |
if ($is_space->{$self->{nc}} or |
if ($is_space->{$self->{nc}} or |
4823 |
{ |
{ |
4824 |
0x003C => 1, 0x0026 => 1, -1 => 1, # <, & |
0x003C => 1, 0x0026 => 1, -1 => 1, # <, & |
4825 |
$self->{entity_add} => 1, |
$self->{entity_add} => 1, |
4826 |
}->{$self->{nc}}) { |
}->{$self->{nc}}) { |
4827 |
|
!!!parse-error (type => 'bare ero', |
4828 |
|
line => $self->{line_prev}, |
4829 |
|
column => $self->{column_prev} |
4830 |
|
+ ($self->{nc} == -1 ? 1 : 0)); |
4831 |
## Don't consume |
## Don't consume |
|
## No error |
|
4832 |
## Return nothing. |
## Return nothing. |
4833 |
# |
# |
4834 |
} elsif ($self->{nc} == 0x0023) { # # |
} elsif ($self->{nc} == 0x0023) { # # |
4837 |
$self->{kwd} = '#'; |
$self->{kwd} = '#'; |
4838 |
!!!next-input-character; |
!!!next-input-character; |
4839 |
redo A; |
redo A; |
|
} elsif ((0x0041 <= $self->{nc} and |
|
|
$self->{nc} <= 0x005A) or # A..Z |
|
|
(0x0061 <= $self->{nc} and |
|
|
$self->{nc} <= 0x007A)) { # a..z |
|
|
# |
|
4840 |
} else { |
} else { |
|
!!!parse-error (type => 'bare ero'); |
|
|
## Return nothing. |
|
4841 |
# |
# |
4842 |
} |
} |
4843 |
|
|