354 |
GETCHAR: { |
GETCHAR: { |
355 |
my $char = substr (${$self->{entity}->[-1]->{reptxt}}, |
my $char = substr (${$self->{entity}->[-1]->{reptxt}}, |
356 |
$self->{entity}->[-1]->{pos}, 1); |
$self->{entity}->[-1]->{pos}, 1); |
|
$self->{entity}->[-1]->{pos}++; |
|
357 |
|
|
358 |
if (defined $char and length $char) { |
if (defined $char and length $char) { |
359 |
|
$self->{entity}->[-1]->{pos}++; |
360 |
$r = ord $char; |
$r = ord $char; |
361 |
if ($r == 0x000A) { |
if ($r == 0x000A) { |
362 |
$self->{entity}->[-1]->{line}++; |
$self->{entity}->[-1]->{line}++; |
366 |
$self->{entity}->[-1]->{pos}, 1); |
$self->{entity}->[-1]->{pos}, 1); |
367 |
if ($next_char eq "\x0A") { |
if ($next_char eq "\x0A") { |
368 |
$self->{entity}->[-1]->{pos}++; |
$self->{entity}->[-1]->{pos}++; |
369 |
|
$self->{entity}->[-1]->{line}++; |
370 |
$self->{entity}->[-1]->{column} = 1; |
$self->{entity}->[-1]->{column} = 1; |
371 |
} elsif ($next_char eq "\x85") { |
} elsif ($next_char eq "\x85") { |
372 |
if ($self->{xml_version} eq '1.1') { |
if ($self->{xml_version} eq '1.1') { |
373 |
$self->{entity}->[-1]->{pos}++; |
$self->{entity}->[-1]->{pos}++; |
374 |
|
$self->{entity}->[-1]->{line}++; |
375 |
$self->{entity}->[-1]->{column} = 1; |
$self->{entity}->[-1]->{column} = 1; |
376 |
} else { |
} else { |
377 |
$self->{entity}->[-1]->{column} = 0; |
$self->{entity}->[-1]->{column}++; |
378 |
|
## Line number will be increased by next |shiftChar| call. |
379 |
} |
} |
380 |
} else { |
} else { |
381 |
|
$self->{entity}->[-1]->{line}++; |
382 |
$self->{entity}->[-1]->{column} = 1; |
$self->{entity}->[-1]->{column} = 1; |
383 |
} |
} |
384 |
$r = 0x000A; |
$r = 0x000A; |
|
$self->{entity}->[-1]->{line}++; |
|
385 |
} elsif ( |
} elsif ( |
386 |
not ((0x0020 <= $r and $r <= 0x007E) or |
not ((0x0020 <= $r and $r <= 0x007E) or |
387 |
(0x00A0 <= $r and $r <= 0xD7FF) or |
(0x00A0 <= $r and $r <= 0xD7FF) or |
392 |
(0x007F <= $r and $r <= 0x009F)) |
(0x007F <= $r and $r <= 0x009F)) |
393 |
) { |
) { |
394 |
my $location = { |
my $location = { |
395 |
utf32_offset => $self->{entity}->[-1]->{pos}, |
utf32_offset => $self->{entity}->[-1]->{pos} - 1, |
396 |
line_number => $self->{entity}->[-1]->{line}, |
line_number => $self->{entity}->[-1]->{line}, |
397 |
column_number => $self->{entity}->[-1]->{column}, |
column_number => $self->{entity}->[-1]->{column}, |
398 |
}; |
}; |
407 |
$self->{entity}->[-1]->{column}++; |
$self->{entity}->[-1]->{column}++; |
408 |
} elsif ($r == 0x0085 or $r == 0x2028) { |
} elsif ($r == 0x0085 or $r == 0x2028) { |
409 |
$r = 0x000A if $self->{xml_version} eq '1.1'; |
$r = 0x000A if $self->{xml_version} eq '1.1'; |
410 |
|
## Even in XML 1.0 it increases the line number. |
411 |
$self->{entity}->[-1]->{line}++; |
$self->{entity}->[-1]->{line}++; |
412 |
$self->{entity}->[-1]->{column} = 1; |
$self->{entity}->[-1]->{column} = 1; |
413 |
} else { |
} else { |
414 |
$self->{entity}->[-1]->{column}++; |
$self->{entity}->[-1]->{column}++; |
415 |
} |
} |
|
# } elsif (@{$self->{entity}} > 1) { |
|
|
# pop @{$self->{entity}}; |
|
|
# redo GETCHAR; |
|
|
# ## ISSUE: How cope with delimiter scanning & |
|
|
# ## self-containedness constraints?? |
|
416 |
} else { |
} else { |
417 |
$r = -1; |
$r = -1; |
418 |
} |
} |
804 |
} |
} |
805 |
$self->{has_error} = true; |
$self->{has_error} = true; |
806 |
} |
} |
807 |
$doc-><AS::Document.xmlStandalone> ($ver); |
if ($ver eq 'yes') { |
808 |
$self->{standalone} = true if $ver eq 'yes'; |
$doc-><AS::Document.xmlStandalone> (true); |
809 |
|
$self->{standalone} = true; |
810 |
|
} |
811 |
} |
} |
812 |
|
|
813 |
~? (S) { } |
~? (S) { } |
3864 |
@@XMLTest: |
@@XMLTest: |
3865 |
@@@QName: xp.syntax.space.test |
@@@QName: xp.syntax.space.test |
3866 |
@@@DEnt: |
@@@DEnt: |
3867 |
@@@@test:value: \ |
@@@@test:value: \ |
3868 |
@@@c:erred: |
@@@c:erred: |
3869 |
<[[xp:wf-syntax-error]]> { (1, 4); } |
<[[xp:wf-syntax-error]]> { (1, 4); } |
3870 |
@@XMLTest: |
@@XMLTest: |
3911 |
text-content: ''; |
text-content: ''; |
3912 |
} |
} |
3913 |
} |
} |
3914 |
|
|
3915 |
|
@@XMLTest: |
3916 |
|
@@@QName: xp.xmldecl.version.1.0.test |
3917 |
|
@@@DEnt: |
3918 |
|
@@@@test:value: |
3919 |
|
<?xml version="1.0"?> |
3920 |
|
<p></p> |
3921 |
|
@@@test:domTree: |
3922 |
|
document { |
3923 |
|
xml-version: '1.0'; |
3924 |
|
xml-encoding: null; |
3925 |
|
xml-standalone: false; |
3926 |
|
element { } |
3927 |
|
} |
3928 |
|
@@XMLTest: |
3929 |
|
@@@QName: xp.xmldecl.version.1.0.lita.test |
3930 |
|
@@@DEnt: |
3931 |
|
@@@@test:value: |
3932 |
|
<?xml version='1.0'?> |
3933 |
|
<p></p> |
3934 |
|
@@@test:domTree: |
3935 |
|
document { |
3936 |
|
xml-version: '1.0'; |
3937 |
|
xml-encoding: null; |
3938 |
|
xml-standalone: false; |
3939 |
|
element { } |
3940 |
|
} |
3941 |
|
@@XMLTest: |
3942 |
|
@@@QName: xp.xmldecl.version.1.0.s.test |
3943 |
|
@@@DEnt: |
3944 |
|
@@@@test:value: |
3945 |
|
<?xml version = "1.0" ?> |
3946 |
|
<p></p> |
3947 |
|
@@@test:domTree: |
3948 |
|
document { |
3949 |
|
xml-version: '1.0'; |
3950 |
|
xml-encoding: null; |
3951 |
|
xml-standalone: false; |
3952 |
|
element { } |
3953 |
|
} |
3954 |
|
@@XMLTest: |
3955 |
|
@@@QName: xp.xmldecl.version.1.1.test |
3956 |
|
@@@DEnt: |
3957 |
|
@@@@test:value: |
3958 |
|
<?xml version="1.1"?> |
3959 |
|
<p></p> |
3960 |
|
@@@test:domTree: |
3961 |
|
document { |
3962 |
|
xml-version: '1.1'; |
3963 |
|
xml-encoding: null; |
3964 |
|
xml-standalone: false; |
3965 |
|
element { } |
3966 |
|
} |
3967 |
|
|
3968 |
|
@@XMLTest: |
3969 |
|
@@@QName: xp.xmldecl.version.1.0.encoding.usascii.test |
3970 |
|
@@@DEnt: |
3971 |
|
@@@@test:value: |
3972 |
|
<?xml version="1.0" encoding="US-ascii"?> |
3973 |
|
<p></p> |
3974 |
|
@@@test:domTree: |
3975 |
|
document { |
3976 |
|
xml-version: '1.0'; |
3977 |
|
xml-encoding: 'US-ascii'; |
3978 |
|
xml-standalone: false; |
3979 |
|
element { } |
3980 |
|
} |
3981 |
|
@@XMLTest: |
3982 |
|
@@@QName: xp.xmldecl.version.1.0.encoding.usascii.lita.test |
3983 |
|
@@@DEnt: |
3984 |
|
@@@@test:value: |
3985 |
|
<?xml version="1.0" encoding='US-ascii'?> |
3986 |
|
<p></p> |
3987 |
|
@@@test:domTree: |
3988 |
|
document { |
3989 |
|
xml-version: '1.0'; |
3990 |
|
xml-encoding: 'US-ascii'; |
3991 |
|
xml-standalone: false; |
3992 |
|
element { } |
3993 |
|
} |
3994 |
|
@@XMLTest: |
3995 |
|
@@@QName: xp.xmldecl.version.1.0.encoding.usascii.s.test |
3996 |
|
@@@DEnt: |
3997 |
|
@@@@test:value: |
3998 |
|
<?xml version="1.0" encoding = "US-ascii" ?> |
3999 |
|
<p></p> |
4000 |
|
@@@test:domTree: |
4001 |
|
document { |
4002 |
|
xml-version: '1.0'; |
4003 |
|
xml-encoding: 'US-ascii'; |
4004 |
|
xml-standalone: false; |
4005 |
|
element { } |
4006 |
|
} |
4007 |
|
|
4008 |
|
@@XMLTest: |
4009 |
|
@@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.test |
4010 |
|
@@@DEnt: |
4011 |
|
@@@@test:value: |
4012 |
|
<?xml version="1.0" encoding="us-ascii" standalone="yes"?> |
4013 |
|
<p></p> |
4014 |
|
@@@test:domTree: |
4015 |
|
document { |
4016 |
|
xml-version: '1.0'; |
4017 |
|
xml-encoding: 'us-ascii'; |
4018 |
|
xml-standalone: true; |
4019 |
|
element { } |
4020 |
|
} |
4021 |
|
@@XMLTest: |
4022 |
|
@@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.no.test |
4023 |
|
@@@DEnt: |
4024 |
|
@@@@test:value: |
4025 |
|
<?xml version="1.0" encoding="us-ascii" standalone="no"?> |
4026 |
|
<p></p> |
4027 |
|
@@@test:domTree: |
4028 |
|
document { |
4029 |
|
xml-version: '1.0'; |
4030 |
|
xml-encoding: 'us-ascii'; |
4031 |
|
xml-standalone: false; |
4032 |
|
element { } |
4033 |
|
} |
4034 |
|
@@XMLTest: |
4035 |
|
@@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.lita.test |
4036 |
|
@@@DEnt: |
4037 |
|
@@@@test:value: |
4038 |
|
<?xml version="1.0" encoding="us-ascii" standalone='yes'?> |
4039 |
|
<p></p> |
4040 |
|
@@@test:domTree: |
4041 |
|
document { |
4042 |
|
xml-version: '1.0'; |
4043 |
|
xml-encoding: 'us-ascii'; |
4044 |
|
xml-standalone: true; |
4045 |
|
element { } |
4046 |
|
} |
4047 |
|
@@XMLTest: |
4048 |
|
@@@QName: xp.xmldecl.version.1.0.encoding.usascii.standalone.yes.s.test |
4049 |
|
@@@DEnt: |
4050 |
|
@@@@test:value: |
4051 |
|
<?xml version="1.0" encoding="us-ascii" standalone = "yes" ?> |
4052 |
|
<p></p> |
4053 |
|
@@@test:domTree: |
4054 |
|
document { |
4055 |
|
xml-version: '1.0'; |
4056 |
|
xml-encoding: 'us-ascii'; |
4057 |
|
xml-standalone: true; |
4058 |
|
element { } |
4059 |
|
} |
4060 |
|
|
4061 |
@@XMLTest: |
@@XMLTest: |
4062 |
@@@QName: xp.doctype.empty.test |
@@@QName: xp.doctype.empty.test |
5122 |
if (@$_) { |
if (@$_) { |
5123 |
$test->failure_comment |
$test->failure_comment |
5124 |
(@$_.' |DOMError|s of type |'. |
(@$_.' |DOMError|s of type |'. |
5125 |
$_->[0]->{type}.'| are not reported'); |
$_->[0]->{type}->{value}.'| are not reported'); |
5126 |
$has_error = true; |
$has_error = true; |
5127 |
} |
} |
5128 |
} |
} |
5146 |
if (@$_) { |
if (@$_) { |
5147 |
$test->failure_comment |
$test->failure_comment |
5148 |
(@$_.' |DOMError|s of type |'. |
(@$_.' |DOMError|s of type |'. |
5149 |
$_->[0]->{type}.'| are not reported'); |
$_->[0]->{type}->{value}.'| are not reported'); |
5150 |
$has_error = true; |
$has_error = true; |
5151 |
} |
} |
5152 |
} |
} |
5201 |
@PerlDef: |
@PerlDef: |
5202 |
$result = { |
$result = { |
5203 |
utf32_offset => $self->{entity}->[-1]->{pos}, |
utf32_offset => $self->{entity}->[-1]->{pos}, |
5204 |
|
line_number => $self->{entity}->[-1]->{line}, |
5205 |
|
column_number => $self->{entity}->[-1]->{column}, |
5206 |
}; |
}; |
5207 |
@For: ManakaiDOM|ManakaiDOM3 |
@For: ManakaiDOM|ManakaiDOM3 |
5208 |
|
|