282 |
column => 1, |
column => 1, |
283 |
pos => 0, |
pos => 0, |
284 |
}]; |
}]; |
285 |
|
$self->{location} = $self->{entity}->[-1]; |
286 |
$self->{entity_char} = []; |
$self->{entity_char} = []; |
287 |
$self->{entity_token} = []; |
$self->{entity_token} = []; |
288 |
$self->{xml_version} = '1.0'; |
$self->{xml_version} = '1.0'; |
322 |
$self->{entity} = [<Code::getCopyOfEntityState:: |
$self->{entity} = [<Code::getCopyOfEntityState:: |
323 |
$entity_type = 'general_entity', |
$entity_type = 'general_entity', |
324 |
$entity_name = $ent_name>]; |
$entity_name = $ent_name>]; |
325 |
|
$self->{location} = $self->{entity}->[-1]; |
326 |
$self->{token} = []; |
$self->{token} = []; |
327 |
$self->{char} = []; |
$self->{char} = []; |
328 |
## TODO: External entity support |
## TODO: External entity support |
629 |
rule _XMLDeclaration_ ($doc) { |
rule _XMLDeclaration_ ($doc) { |
630 |
?lexmode XMLDeclaration; |
?lexmode XMLDeclaration; |
631 |
|
|
632 |
~ (S) { } |
// ~ (XDO) { } |
633 |
|
// ~ (S) { } |
634 |
|
|
635 |
~ (Name == 'version') { |
~ (Name == 'version') { |
636 |
~? (S) { } |
~? (S) { } |
903 |
$pi = $doc-><M::Document.createProcessingInstruction> |
$pi = $doc-><M::Document.createProcessingInstruction> |
904 |
($name); |
($name); |
905 |
} |
} |
906 |
|
} else { |
907 |
|
lang:Perl { |
908 |
|
$pi = $doc-><M::Document.createProcessingInstruction> ('#INVALID'); |
909 |
|
} |
910 |
} |
} |
911 |
|
|
912 |
~ (S) { |
~? (S) { |
913 |
?lexmode 'PIData'; |
?lexmode 'PIData'; |
914 |
|
|
915 |
my $tdata; |
my $tdata; |
967 |
$pi = $doc-><M::Document.createProcessingInstruction> |
$pi = $doc-><M::Document.createProcessingInstruction> |
968 |
($name); |
($name); |
969 |
} |
} |
970 |
|
} else { |
971 |
|
lang:Perl { |
972 |
|
$pi = $doc-><M::Document.createProcessingInstruction> ('#INVALID'); |
973 |
|
} |
974 |
} |
} |
975 |
|
|
976 |
~ (S) { |
~? (S) { |
977 |
?lexmode 'PIData'; |
?lexmode 'PIData'; |
978 |
|
|
979 |
my $tdata; |
my $tdata; |
2074 |
push @{$self->{entity}}, <Code::getCopyOfEntityState:: |
push @{$self->{entity}}, <Code::getCopyOfEntityState:: |
2075 |
$entity_type = 'general_entity', |
$entity_type = 'general_entity', |
2076 |
$entity_name = $name>; |
$entity_name = $name>; |
2077 |
|
$self->{location} = $self->{entity}->[-1]; |
2078 |
push @{$self->{entity_token}}, $self->{token}; |
push @{$self->{entity_token}}, $self->{token}; |
2079 |
$self->{token} = []; |
$self->{token} = []; |
2080 |
push @{$self->{entity_char}}, $self->{char}; |
push @{$self->{entity_char}}, $self->{char}; |
2088 |
$self->{token} = pop @{$self->{entity_token}}; |
$self->{token} = pop @{$self->{entity_token}}; |
2089 |
$self->{char} = pop @{$self->{entity_char}}; |
$self->{char} = pop @{$self->{entity_char}}; |
2090 |
pop @{$self->{entity}}; |
pop @{$self->{entity}}; |
2091 |
|
$self->{location} = $self->{entity}->[-1]; |
2092 |
} |
} |
2093 |
|
|
2094 |
// TODO: Set read-only flag |
// TODO: Set read-only flag |
2151 |
push @{$self->{entity}}, <Code::getCopyOfEntityState:: |
push @{$self->{entity}}, <Code::getCopyOfEntityState:: |
2152 |
$entity_type = 'general_entity', |
$entity_type = 'general_entity', |
2153 |
$entity_name = $name>; |
$entity_name = $name>; |
2154 |
|
$self->{location} = $self->{entity}->[-1]; |
2155 |
push @{$self->{entity_token}}, $self->{token}; |
push @{$self->{entity_token}}, $self->{token}; |
2156 |
$self->{token} = []; |
$self->{token} = []; |
2157 |
push @{$self->{entity_char}}, $self->{char}; |
push @{$self->{entity_char}}, $self->{char}; |
2165 |
$self->{token} = pop @{$self->{entity_token}}; |
$self->{token} = pop @{$self->{entity_token}}; |
2166 |
$self->{char} = pop @{$self->{entity_char}}; |
$self->{char} = pop @{$self->{entity_char}}; |
2167 |
pop @{$self->{entity}}; |
pop @{$self->{entity}}; |
2168 |
|
$self->{location} = $self->{entity}->[-1]; |
2169 |
} |
} |
2170 |
|
|
2171 |
// TODO: Set read-only flag |
// TODO: Set read-only flag |
2226 |
push @{$self->{entity}}, <Code::getCopyOfEntityState:: |
push @{$self->{entity}}, <Code::getCopyOfEntityState:: |
2227 |
$entity_type = 'general_entity', |
$entity_type = 'general_entity', |
2228 |
$entity_name = $name>; |
$entity_name = $name>; |
2229 |
|
$self->{location} = $self->{entity}->[-1]; |
2230 |
push @{$self->{entity_token}}, $self->{token}; |
push @{$self->{entity_token}}, $self->{token}; |
2231 |
$self->{token} = []; |
$self->{token} = []; |
2232 |
push @{$self->{entity_char}}, $self->{char}; |
push @{$self->{entity_char}}, $self->{char}; |
2240 |
$self->{token} = pop @{$self->{entity_token}}; |
$self->{token} = pop @{$self->{entity_token}}; |
2241 |
$self->{char} = pop @{$self->{entity_char}}; |
$self->{char} = pop @{$self->{entity_char}}; |
2242 |
pop @{$self->{entity}}; |
pop @{$self->{entity}}; |
2243 |
|
$self->{location} = $self->{entity}->[-1]; |
2244 |
} |
} |
2245 |
|
|
2246 |
// TODO: Set read-only flag |
// TODO: Set read-only flag |
3340 |
} // Nmtoken |
} // Nmtoken |
3341 |
|
|
3342 |
/* |
/* |
3343 |
Space |
S |
3344 |
*/ |
*/ |
3345 |
lexmode S { |
lexmode S { |
3346 |
S := [U+0009 U+000A U+000D U+0020]+; |
$s := [U+0009 U+000A U+000D U+0020]; |
3347 |
|
S := $s+; |
3348 |
} // S |
} // S |
3349 |
|
|
3350 |
/* |
/* |
3405 |
/* |
/* |
3406 |
XML declaration |
XML declaration |
3407 |
*/ |
*/ |
3408 |
XDO := ['<'] ['?'] ['x'] ['m'] ['l']; |
XDO := ['<'] ['?'] ['x'] ['m'] ['l'] $s+; |
3409 |
} // DocumentStart |
} // DocumentStart |
3410 |
|
|
3411 |
/* |
/* |
4075 |
xml-standalone: true; |
xml-standalone: true; |
4076 |
element { } |
element { } |
4077 |
} |
} |
4078 |
|
@@XMLTest: |
4079 |
|
@@@QName: xp.xmldecl.no.encoding.but.standalone.attr.test |
4080 |
|
@@@DEnt: |
4081 |
|
@@@@test:value: |
4082 |
|
<?xml version="1.0" standalone="yes"?> |
4083 |
|
<p></p> |
4084 |
|
@@@test:domTree: |
4085 |
|
document { |
4086 |
|
xml-version: '1.0'; |
4087 |
|
xml-encoding: null; |
4088 |
|
xml-standalone: true; |
4089 |
|
element { } |
4090 |
|
} |
4091 |
|
@@XMLTest: |
4092 |
|
@@@QName: xp.xmldecl.encoding.encname.test |
4093 |
|
@@@DEnt: |
4094 |
|
@@@@test:value: |
4095 |
|
<?xml version="1.0" encoding="a-._01-"?> |
4096 |
|
<p></p> |
4097 |
|
@@@test:domTree: |
4098 |
|
document { |
4099 |
|
xml-version: '1.0'; |
4100 |
|
xml-encoding: 'a-._01-'; |
4101 |
|
xml-standalone: false; |
4102 |
|
element { } |
4103 |
|
} |
4104 |
|
|
4105 |
|
@@XMLTest: |
4106 |
|
@@@QName: xp.xmldecl.no.s.no.attr.test |
4107 |
|
@@@DEnt: |
4108 |
|
@@@@test:value: |
4109 |
|
<?xml?> |
4110 |
|
<p></p> |
4111 |
|
@@@c:erred: |
4112 |
|
<[[xp:wf-pi-target-is-xml]]> { (1, 1)..(1, 5); } |
4113 |
|
@@XMLTest: |
4114 |
|
@@@QName: xp.xmldecl.s.no.attr.test |
4115 |
|
@@@DEnt: |
4116 |
|
@@@@test:value: |
4117 |
|
<?xml ?> |
4118 |
|
<p></p> |
4119 |
|
@@@c:erred: |
4120 |
|
<[[xp:wf-syntax-error]]> { (1, 8)..(1, 9); } |
4121 |
|
@@XMLTest: |
4122 |
|
@@@QName: xp.xmldecl.unknown.attr.test |
4123 |
|
@@@DEnt: |
4124 |
|
@@@@test:value: |
4125 |
|
<?xml unknown="value"?> |
4126 |
|
<p></p> |
4127 |
|
@@@c:erred: |
4128 |
|
<[[xp:wf-syntax-error]]> { (1, 8)..(1, 22); } |
4129 |
|
@@XMLTest: |
4130 |
|
@@@QName: xp.xmldecl.version.unknown.attr.test |
4131 |
|
@@@DEnt: |
4132 |
|
@@@@test:value: |
4133 |
|
<?xml version="1.0" unknown="value"?> |
4134 |
|
<p></p> |
4135 |
|
@@@c:erred: |
4136 |
|
<[[xp:wf-syntax-error]]> { (1, 21)..(1, 35); } |
4137 |
|
@@XMLTest: |
4138 |
|
@@@QName: xp.xmldecl.version.encoding.unknown.attr.test |
4139 |
|
@@@DEnt: |
4140 |
|
@@@@test:value: |
4141 |
|
<?xml version="1.0" encoding="us-ascii" unknown="value"?> |
4142 |
|
<p></p> |
4143 |
|
@@@c:erred: |
4144 |
|
<[[xp:wf-syntax-error]]> { (1, 41)..(1, 55); } |
4145 |
|
@@XMLTest: |
4146 |
|
@@@QName: xp.xmldecl.version.encoding.standalone.unknown.attr.test |
4147 |
|
@@@DEnt: |
4148 |
|
@@@@test:value: |
4149 |
|
<?xml version="1.0" encoding="us-ascii" standalone="yes" |
4150 |
|
unknown="value"?> |
4151 |
|
<p></p> |
4152 |
|
@@@c:erred: |
4153 |
|
<[[xp:wf-syntax-error]]> { (2, 1)..(2, 15); } |
4154 |
|
@@XMLTest: |
4155 |
|
@@@QName: xp.xmldecl.no.version.but.encoding.attr.test |
4156 |
|
@@@DEnt: |
4157 |
|
@@@@test:value: |
4158 |
|
<?xml encoding="us-ascii"?> |
4159 |
|
<p></p> |
4160 |
|
@@@c:erred: |
4161 |
|
<[[xp:wf-syntax-error]]> { (1, 7)..(1, 25); } |
4162 |
|
@@XMLTest: |
4163 |
|
@@@QName: xp.xmldecl.no.version.but.standalone.attr.test |
4164 |
|
@@@DEnt: |
4165 |
|
@@@@test:value: |
4166 |
|
<?xml standalone="yes"?> |
4167 |
|
<p></p> |
4168 |
|
@@@c:erred: |
4169 |
|
<[[xp:wf-syntax-error]]> { (1, 7)..(1, 24); } |
4170 |
|
@@XMLTest: |
4171 |
|
@@@QName: xp.xmldecl.version.unsupported.test |
4172 |
|
@@@DEnt: |
4173 |
|
@@@@test:value: |
4174 |
|
<?xml version="1.2"?> |
4175 |
|
<p></p> |
4176 |
|
@@@c:erred: |
4177 |
|
<[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 19); } |
4178 |
|
@@XMLTest: |
4179 |
|
@@@QName: xp.xmldecl.version.unsupported.2.test |
4180 |
|
@@@DEnt: |
4181 |
|
@@@@test:value: |
4182 |
|
<?xml version=" 1.0 "?> |
4183 |
|
<p></p> |
4184 |
|
@@@c:erred: |
4185 |
|
<[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 21); } |
4186 |
|
@@XMLTest: |
4187 |
|
@@@QName: xp.xmldecl.version.unsupported.3.test |
4188 |
|
@@@DEnt: |
4189 |
|
@@@@test:value: |
4190 |
|
<?xml version="01.00"?> |
4191 |
|
<p></p> |
4192 |
|
@@@c:erred: |
4193 |
|
<[[xp:wf-unsupported-xml-version]]> { (1, 7)..(1, 21); } |
4194 |
|
@@XMLTest: |
4195 |
|
@@@QName: xp.xmldecl.encoding.malformed.1.test |
4196 |
|
@@@DEnt: |
4197 |
|
@@@@test:value: |
4198 |
|
<?xml version="1.0" encoding="0088"?> |
4199 |
|
<p></p> |
4200 |
|
@@@c:erred: |
4201 |
|
<[[xp:wf-malformed-enc-name]]> { (1, 21)..(1, 35); } |
4202 |
|
@@XMLTest: |
4203 |
|
@@@QName: xp.xmldecl.encoding.malformed.2.test |
4204 |
|
@@@DEnt: |
4205 |
|
@@@@test:value: |
4206 |
|
<?xml version="1.0" encoding="D.V.D!"?> |
4207 |
|
<p></p> |
4208 |
|
@@@c:erred: |
4209 |
|
<[[xp:wf-malformed-enc-name]]> { (1, 21)..(1, 38); } |
4210 |
|
@@XMLTest: |
4211 |
|
@@@QName: xp.xmldecl.standalone.malformed.1.test |
4212 |
|
@@@DEnt: |
4213 |
|
@@@@test:value: |
4214 |
|
<?xml version="1.0" standalone="true"?> |
4215 |
|
<p></p> |
4216 |
|
@@@c:erred: |
4217 |
|
<[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 38); } |
4218 |
|
@@XMLTest: |
4219 |
|
@@@QName: xp.xmldecl.standalone.malformed.2.test |
4220 |
|
@@@DEnt: |
4221 |
|
@@@@test:value: |
4222 |
|
<?xml version="1.0" standalone="YES"?> |
4223 |
|
<p></p> |
4224 |
|
@@@c:erred: |
4225 |
|
<[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 37); } |
4226 |
|
@@XMLTest: |
4227 |
|
@@@QName: xp.xmldecl.standalone.malformed.3.test |
4228 |
|
@@@DEnt: |
4229 |
|
@@@@test:value: |
4230 |
|
<?xml version="1.0" standalone="no "?> |
4231 |
|
<p></p> |
4232 |
|
@@@c:erred: |
4233 |
|
<[[xp:wf-malformed-xml-standalone]]> { (1, 21)..(1, 38); } |
4234 |
|
|
4235 |
@@XMLTest: |
@@XMLTest: |
4236 |
|
@@@QName: xp.no-xmldecl.xml...-pi.test |
4237 |
|
@@@DEnt: |
4238 |
|
@@@@test:value: |
4239 |
|
<?xmldeclaration?> |
4240 |
|
<a></a> |
4241 |
|
@@@test:domTree: |
4242 |
|
document { |
4243 |
|
pi { |
4244 |
|
node-name: 'xmldeclaration'; |
4245 |
|
node-value: ''; |
4246 |
|
} |
4247 |
|
element { } |
4248 |
|
} |
4249 |
|
@@XMLTest: |
4250 |
|
@@@QName: xp.no-xmldecl.xml...-pi.after.document.element.test |
4251 |
|
@@@DEnt: |
4252 |
|
@@@@test:value: |
4253 |
|
<a></a> |
4254 |
|
<?xmldeclaration?> |
4255 |
|
@@@test:domTree: |
4256 |
|
document { |
4257 |
|
element { } |
4258 |
|
pi { |
4259 |
|
node-name: 'xmldeclaration'; |
4260 |
|
node-value: ''; |
4261 |
|
} |
4262 |
|
} |
4263 |
|
@@XMLTest: |
4264 |
|
@@@QName: xp.no-xmldecl.xml...-pi.in.document.element.test |
4265 |
|
@@@DEnt: |
4266 |
|
@@@@test:value: |
4267 |
|
<a> |
4268 |
|
<?xmldeclaration?> |
4269 |
|
</a> |
4270 |
|
@@@test:domTree: |
4271 |
|
document { |
4272 |
|
element { |
4273 |
|
text { } |
4274 |
|
pi { |
4275 |
|
node-name: 'xmldeclaration'; |
4276 |
|
node-value: ''; |
4277 |
|
} |
4278 |
|
text { } |
4279 |
|
} |
4280 |
|
} |
4281 |
|
@@XMLTest: |
4282 |
|
@@@QName: xp.no-xmldecl.xml...-pi.in.doctype.test |
4283 |
|
@@@DEnt: |
4284 |
|
@@@@test:value: |
4285 |
|
<!DOCTYPE a [ |
4286 |
|
<?xmldeclaration?> |
4287 |
|
]> |
4288 |
|
<a></a> |
4289 |
|
@@@test:domTree: |
4290 |
|
document { |
4291 |
|
document-type { |
4292 |
|
pi { |
4293 |
|
node-name: 'xmldeclaration'; |
4294 |
|
node-value: ''; |
4295 |
|
} |
4296 |
|
} |
4297 |
|
element { } |
4298 |
|
} |
4299 |
|
|
4300 |
|
@@XMLTest: |
4301 |
|
@@@QName: xp.XMLdecl.test |
4302 |
|
@@@DEnt: |
4303 |
|
@@@@test:value: |
4304 |
|
<?XML version="1.0"?> |
4305 |
|
<p></p> |
4306 |
|
@@@c:erred: |
4307 |
|
<[[xp:wf-pi-target-is-xml]]> { (1, 1)..(1, 5); } |
4308 |
|
@@XMLTest: |
4309 |
|
@@@QName: xp.Xmldecl.test |
4310 |
|
@@@DEnt: |
4311 |
|
@@@@test:value: |
4312 |
|
<?Xml version="1.0"?> |
4313 |
|
<p></p> |
4314 |
|
@@@c:erred: |
4315 |
|
<[[xp:wf-pi-target-is-xml]]> { (1, 1)..(1, 5); } |
4316 |
|
@@XMLTest: |
4317 |
|
@@@QName: xp.xmldecl.after.document.element.empty.test |
4318 |
|
@@@DEnt: |
4319 |
|
@@@@test:value: |
4320 |
|
<p></p> |
4321 |
|
<?xml?> |
4322 |
|
@@@c:erred: |
4323 |
|
<[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); } |
4324 |
|
@@XMLTest: |
4325 |
|
@@@QName: xp.xmldecl.after.document.element.test |
4326 |
|
@@@DEnt: |
4327 |
|
@@@@test:value: |
4328 |
|
<p></p> |
4329 |
|
<?xml version="1.0"?> |
4330 |
|
@@@c:erred: |
4331 |
|
<[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); } |
4332 |
|
@@XMLTest: |
4333 |
|
@@@QName: xp.xmldecl.in.element.empty.test |
4334 |
|
@@@DEnt: |
4335 |
|
@@@@test:value: |
4336 |
|
<p> |
4337 |
|
<?xml?> |
4338 |
|
</p> |
4339 |
|
@@@c:erred: |
4340 |
|
<[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); } |
4341 |
|
@@XMLTest: |
4342 |
|
@@@QName: xp.xmldecl.in.element.test |
4343 |
|
@@@DEnt: |
4344 |
|
@@@@test:value: |
4345 |
|
<p> |
4346 |
|
<?xml version="1.0"?> |
4347 |
|
</p> |
4348 |
|
@@@c:erred: |
4349 |
|
<[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); } |
4350 |
|
@@XMLTest: |
4351 |
|
@@@QName: xp.xmldecl.after.comment.test |
4352 |
|
@@@DEnt: |
4353 |
|
@@@@test:value: |
4354 |
|
<!----> |
4355 |
|
<?xml version="1.0"?> |
4356 |
|
<p></p> |
4357 |
|
@@@c:erred: |
4358 |
|
<[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); } |
4359 |
|
@@XMLTest: |
4360 |
|
@@@QName: xp.xmldecl.after.comment.empty.test |
4361 |
|
@@@DEnt: |
4362 |
|
@@@@test:value: |
4363 |
|
<!----> |
4364 |
|
<?xml?> |
4365 |
|
<p></p> |
4366 |
|
@@@c:erred: |
4367 |
|
<[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); } |
4368 |
|
@@XMLTest: |
4369 |
|
@@@QName: xp.xmldecl.after.pi.test |
4370 |
|
@@@DEnt: |
4371 |
|
@@@@test:value: |
4372 |
|
<?xml-declaration?> |
4373 |
|
<?xml version="1.0"?> |
4374 |
|
<p></p> |
4375 |
|
@@@c:erred: |
4376 |
|
<[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); } |
4377 |
|
@@XMLTest: |
4378 |
|
@@@QName: xp.xmldecl.after.pi.empty.test |
4379 |
|
@@@DEnt: |
4380 |
|
@@@@test:value: |
4381 |
|
<?xml-declaration?> |
4382 |
|
<?xml?> |
4383 |
|
<p></p> |
4384 |
|
@@@c:erred: |
4385 |
|
<[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); } |
4386 |
|
@@XMLTest: |
4387 |
|
@@@QName: xp.xmldecl.after.doctype.test |
4388 |
|
@@@DEnt: |
4389 |
|
@@@@test:value: |
4390 |
|
<!DOCTYPE a> |
4391 |
|
<?xml version="1.0"?> |
4392 |
|
<p></p> |
4393 |
|
@@@c:erred: |
4394 |
|
<[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); } |
4395 |
|
@@XMLTest: |
4396 |
|
@@@QName: xp.xmldecl.after.doctype.empty.test |
4397 |
|
@@@DEnt: |
4398 |
|
@@@@test:value: |
4399 |
|
<!DOCTYPE a> |
4400 |
|
<?xml?> |
4401 |
|
<p></p> |
4402 |
|
@@@c:erred: |
4403 |
|
<[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); } |
4404 |
|
@@XMLTest: |
4405 |
|
@@@QName: xp.xmldecl.in.doctype.test |
4406 |
|
@@@DEnt: |
4407 |
|
@@@@test:value: |
4408 |
|
<!DOCTYPE a [ |
4409 |
|
<?xml version="1.0"?> |
4410 |
|
]> |
4411 |
|
<p></p> |
4412 |
|
@@@c:erred: |
4413 |
|
<[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); } |
4414 |
|
@@XMLTest: |
4415 |
|
@@@QName: xp.xmldecl.in.doctype.empty.test |
4416 |
|
@@@DEnt: |
4417 |
|
@@@@test:value: |
4418 |
|
<!DOCTYPE a [ |
4419 |
|
<?xml?> |
4420 |
|
]> |
4421 |
|
<p></p> |
4422 |
|
@@@c:erred: |
4423 |
|
<[[xp:wf-pi-target-is-xml]]> { (2, 1)..(2, 5); } |
4424 |
|
|
4425 |
|
@@XMLTest: |
4426 |
|
@@@QName: xp.pi.before.element.empty.test |
4427 |
|
@@@DEnt: |
4428 |
|
@@@@test:value: |
4429 |
|
<?target?> |
4430 |
|
<a></a> |
4431 |
|
@@@test:domTree: |
4432 |
|
document { |
4433 |
|
pi { |
4434 |
|
node-name: 'target'; |
4435 |
|
node-value: ''; |
4436 |
|
} |
4437 |
|
element { } |
4438 |
|
} |
4439 |
|
@@XMLTest: |
4440 |
|
@@@QName: xp.pi.before.element.s.test |
4441 |
|
@@@DEnt: |
4442 |
|
@@@@test:value: |
4443 |
|
<?target ?> |
4444 |
|
<a></a> |
4445 |
|
@@@test:domTree: |
4446 |
|
document { |
4447 |
|
pi { |
4448 |
|
node-name: 'target'; |
4449 |
|
node-value: ''; |
4450 |
|
} |
4451 |
|
element { } |
4452 |
|
} |
4453 |
|
@@XMLTest: |
4454 |
|
@@@QName: xp.pi.before.element.string.test |
4455 |
|
@@@DEnt: |
4456 |
|
@@@@test:value: |
4457 |
|
<?target string?> |
4458 |
|
<a></a> |
4459 |
|
@@@test:domTree: |
4460 |
|
document { |
4461 |
|
pi { |
4462 |
|
node-name: 'target'; |
4463 |
|
node-value: 'string'; |
4464 |
|
} |
4465 |
|
element { } |
4466 |
|
} |
4467 |
|
@@XMLTest: |
4468 |
|
@@@QName: xp.pi.before.element.string.s.test |
4469 |
|
@@@DEnt: |
4470 |
|
@@@@test:value: |
4471 |
|
<?target string ?> |
4472 |
|
<a></a> |
4473 |
|
@@@test:domTree: |
4474 |
|
document { |
4475 |
|
pi { |
4476 |
|
node-name: 'target'; |
4477 |
|
node-value: 'string '; |
4478 |
|
} |
4479 |
|
element { } |
4480 |
|
} |
4481 |
|
@@XMLTest: |
4482 |
|
@@@QName: xp.pi.before.element.gt.test |
4483 |
|
@@@DEnt: |
4484 |
|
@@@@test:value: |
4485 |
|
<?target string>string?> |
4486 |
|
<a></a> |
4487 |
|
@@@test:domTree: |
4488 |
|
document { |
4489 |
|
pi { |
4490 |
|
node-name: 'target'; |
4491 |
|
node-value: 'string>string'; |
4492 |
|
} |
4493 |
|
element { } |
4494 |
|
} |
4495 |
|
@@XMLTest: |
4496 |
|
@@@QName: xp.pi.doctype.empty.test |
4497 |
|
@@@DEnt: |
4498 |
|
@@@@test:value: |
4499 |
|
<!DOCTYPE a [ |
4500 |
|
<?target?> |
4501 |
|
]> |
4502 |
|
<a></a> |
4503 |
|
@@@test:domTree: |
4504 |
|
document { |
4505 |
|
document-type { |
4506 |
|
pi { |
4507 |
|
node-name: 'target'; |
4508 |
|
node-value: ''; |
4509 |
|
} |
4510 |
|
} |
4511 |
|
element { } |
4512 |
|
} |
4513 |
|
|
4514 |
|
@@XMLTest: |
4515 |
|
@@@QName: xp.pi.no.target.test |
4516 |
|
@@@DEnt: |
4517 |
|
@@@@test:value: |
4518 |
|
<??> |
4519 |
|
<p></p> |
4520 |
|
@@@c:erred: |
4521 |
|
<[[xp:wf-syntax-error]]> { (1, 3)..(1, 4); } |
4522 |
|
@@XMLTest: |
4523 |
|
@@@QName: xp.pi.no.target.2.test |
4524 |
|
@@@DEnt: |
4525 |
|
@@@@test:value: |
4526 |
|
<? ?> |
4527 |
|
<p></p> |
4528 |
|
@@@c:erred: |
4529 |
|
<[[xp:wf-syntax-error]]> { (1, 3)..(1, 4); } |
4530 |
|
@@XMLTest: |
4531 |
|
@@@QName: xp.pi.bad.target.1.test |
4532 |
|
@@@DEnt: |
4533 |
|
@@@@test:value: |
4534 |
|
<?target! ?> |
4535 |
|
<p></p> |
4536 |
|
@@@c:erred: |
4537 |
|
<[[xp:wf-syntax-error]]> { (1, 9)..(1, 9); } |
4538 |
|
@@XMLTest: |
4539 |
|
@@@QName: xp.pi.bad.target.2.test |
4540 |
|
@@@DEnt: |
4541 |
|
@@@@test:value: |
4542 |
|
<?0target ?> |
4543 |
|
<p></p> |
4544 |
|
@@@c:erred: |
4545 |
|
<[[xp:wf-syntax-error]]> { (1, 3)..(1, 3); } |
4546 |
|
|
4547 |
|
@@XMLTest: |
4548 |
@@@QName: xp.doctype.empty.test |
@@@QName: xp.doctype.empty.test |
4549 |
@@@DEnt: |
@@@DEnt: |
4550 |
@@@@test:value: |
@@@@test:value: |
5582 |
for my $test_data (@$TestData) { |
for my $test_data (@$TestData) { |
5583 |
$test->start_new_test ($test_data->{uri}); |
$test->start_new_test ($test_data->{uri}); |
5584 |
my $doc_ent = $test_data->{entity}->{$test_data->{root_uri}}; |
my $doc_ent = $test_data->{entity}->{$test_data->{root_uri}}; |
5585 |
|
my $not_ok; |
5586 |
|
|
5587 |
$parser->dom_config->set_parameter ('error-handler' => sub ($$) { |
$parser->dom_config->set_parameter ('error-handler' => sub ($$) { |
5588 |
my (undef, $err) = @_; |
my (undef, $err) = @_; |
5594 |
->{$err_type}}); |
->{$err_type}}); |
5595 |
} else { # Uncatched error |
} else { # Uncatched error |
5596 |
warn $err; |
warn $err; |
5597 |
|
unless ($err->severity == <C::c|DOMError.SEVERITY_WARNING>) { |
5598 |
|
$test->failure_comment ('Unexpected error |'.$err->type.'|'); |
5599 |
|
$not_ok = true; |
5600 |
|
} |
5601 |
} |
} |
5602 |
return true; # continue as far as possible |
return true; # continue as far as possible |
5603 |
}); |
}); |
5608 |
$test->assert_dom_tree_equals |
$test->assert_dom_tree_equals |
5609 |
(actual_value => $doc, |
(actual_value => $doc, |
5610 |
expected_hash => $test_data->{dom_tree}); |
expected_hash => $test_data->{dom_tree}); |
|
my $has_error; |
|
5611 |
for (values %{$test_data->{dom_error}||{}}) { |
for (values %{$test_data->{dom_error}||{}}) { |
5612 |
if (@$_) { |
if (@$_) { |
5613 |
$test->failure_comment |
$test->failure_comment |
5614 |
(@$_.' |DOMError|s of type |'. |
(@$_.' |DOMError|s of type |'. |
5615 |
$_->[0]->{type}->{value}.'| are not reported'); |
$_->[0]->{type}->{value}.'| are not reported'); |
5616 |
$has_error = true; |
$not_ok = true; |
5617 |
} |
} |
5618 |
} |
} |
5619 |
$has_error ? $test->not_ok : $test->ok; |
$not_ok ? $test->not_ok : $test->ok; |
5620 |
} catch Message::Util::IF::DTException with { |
} catch Message::Util::IF::DTException with { |
5621 |
# |
# |
5622 |
} catch Message::DOM::IF::LSException with { |
} catch Message::DOM::IF::LSException with { |
5623 |
$test->assert_never; |
# not_ok |
5624 |
|
} otherwise { |
5625 |
|
my $err = shift; |
5626 |
|
warn $err; |
5627 |
|
$test->not_ok; |
5628 |
}; |
}; |
5629 |
} else { |
} else { |
5630 |
try { |
try { |
5634 |
# |
# |
5635 |
} catch Message::DOM::IF::LSException with { |
} catch Message::DOM::IF::LSException with { |
5636 |
# |
# |
5637 |
|
} otherwise { |
5638 |
|
my $err = shift; |
5639 |
|
warn $err; |
5640 |
|
$test->not_ok; |
5641 |
}; |
}; |
|
my $has_error; |
|
5642 |
for (values %{$test_data->{dom_error}||{}}) { |
for (values %{$test_data->{dom_error}||{}}) { |
5643 |
if (@$_) { |
if (@$_) { |
5644 |
$test->failure_comment |
$test->failure_comment |
5645 |
(@$_.' |DOMError|s of type |'. |
(@$_.' |DOMError|s of type |'. |
5646 |
$_->[0]->{type}->{value}.'| are not reported'); |
$_->[0]->{type}->{value}.'| are not reported'); |
5647 |
$has_error = true; |
$not_ok = true; |
5648 |
} |
} |
5649 |
} |
} |
5650 |
$has_error ? $test->not_ok : $test->ok; |
$not_ok ? $test->not_ok : $test->ok; |
5651 |
} |
} |
5652 |
} |
} |
5653 |
|
|
5696 |
@enDesc: |
@enDesc: |
5697 |
Creates a <IF::DOMCore:DOMLocator> object from a token. |
Creates a <IF::DOMCore:DOMLocator> object from a token. |
5698 |
@PerlDef: |
@PerlDef: |
5699 |
|
my $__d = $token->{type} ne '#EOF' |
5700 |
|
? $token->{location}->{char_d} |
5701 |
|
: 0; |
5702 |
$result = { |
$result = { |
5703 |
utf32_offset => $self->{entity}->[-1]->{pos}, |
utf32_offset => $token->{location}->{pos} - $__d, |
5704 |
line_number => $self->{entity}->[-1]->{line}, |
line_number => $token->{location}->{line}, |
5705 |
column_number => $self->{entity}->[-1]->{column}, |
column_number => $token->{location}->{column} - $__d, |
5706 |
}; |
}; |
5707 |
|
$result->{utf32_offset} = 0 if $result->{utf32_offset} < 0; |
5708 |
|
$result->{column_number} = 0 if $result->{column_number} < 0; |
5709 |
|
## 0 or 1, which should be? |
5710 |
@For: ManakaiDOM|ManakaiDOM3 |
@For: ManakaiDOM|ManakaiDOM3 |
5711 |
|
|
5712 |
ElementTypeBinding: |
ElementTypeBinding: |