24 |
@@Module: |
@@Module: |
25 |
@@@QName: MDOM|XDoctype |
@@@QName: MDOM|XDoctype |
26 |
@@@WithFor: ManakaiDOM|ManakaiDOMLatest |
@@@WithFor: ManakaiDOM|ManakaiDOMLatest |
27 |
|
@@Module: |
28 |
|
@@@QName: MCharset|Encode |
29 |
|
@@@WithFor: ManakaiDOM|ManakaiDOMLatest |
30 |
|
|
31 |
Namespace: |
Namespace: |
32 |
@c: |
@c: |
33 |
http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core# |
http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core# |
34 |
@cfg: |
@cfg: |
35 |
http://suika.fam.cx/www/2006/dom-config/ |
http://suika.fam.cx/www/2006/dom-config/ |
36 |
|
@cs: |
37 |
|
http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/ |
38 |
@d: |
@d: |
39 |
http://suika.fam.cx/~wakaba/archive/2004/dom/xdt# |
http://suika.fam.cx/~wakaba/archive/2004/dom/xdt# |
40 |
@dis: |
@dis: |
65 |
http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom# |
http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom# |
66 |
@ManakaiDOMLS: |
@ManakaiDOMLS: |
67 |
http://suika.fam.cx/~wakaba/archive/2004/mdom-ls# |
http://suika.fam.cx/~wakaba/archive/2004/mdom-ls# |
68 |
|
@MCharset: |
69 |
|
http://suika.fam.cx/~wakaba/archive/2005/manakai/Charset/ |
70 |
|
@mce: |
71 |
|
http://suika.fam.cx/~wakaba/archive/2005/manakai/Charset/Encode/ |
72 |
@MDOM: |
@MDOM: |
73 |
http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#ManakaiDOM. |
http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#ManakaiDOM. |
74 |
@MDOMX: |
@MDOMX: |
97 |
http://suika.fam.cx/~wakaba/archive/2004/dom/xml# |
http://suika.fam.cx/~wakaba/archive/2004/dom/xml# |
98 |
@xml: |
@xml: |
99 |
http://www.w3.org/XML/1998/namespace |
http://www.w3.org/XML/1998/namespace |
100 |
|
@xml-auto-charset: |
101 |
|
http://suika.fam.cx/www/2006/03/xml-entity/ |
102 |
@xml-dtd: |
@xml-dtd: |
103 |
http://www.w3.org/TR/REC-xml |
http://www.w3.org/TR/REC-xml |
104 |
@xmlns: |
@xmlns: |
578 |
-><M::c|DOMConfiguration.getParameter> |
-><M::c|DOMConfiguration.getParameter> |
579 |
(<Q::xp|ls-input-to-input-file>); |
(<Q::xp|ls-input-to-input-file>); |
580 |
$in = $self->{in_in}-><M::ManakaiDOMLSInputToInputFile.resolveLSInput> |
$in = $self->{in_in}-><M::ManakaiDOMLSInputToInputFile.resolveLSInput> |
581 |
($input, |
($self->{<H::f|implementation>}, $input, |
582 |
|
$self, |
583 |
$self->{parser_cfg} |
$self->{parser_cfg} |
584 |
-><M::c|DOMConfiguration.getParameter> |
-><M::c|DOMConfiguration.getParameter> |
585 |
('error-handler')); |
('error-handler')); |
599 |
fh => $in-><AG::ManakaiDOMInputFile.filehandle>, |
fh => $in-><AG::ManakaiDOMInputFile.filehandle>, |
600 |
base_uri => $in-><AG::ManakaiDOMInputFile.baseURI>, |
base_uri => $in-><AG::ManakaiDOMInputFile.baseURI>, |
601 |
doc_uri => $in-><AG::ManakaiDOMInputFile.documentURI>, |
doc_uri => $in-><AG::ManakaiDOMInputFile.documentURI>, |
602 |
|
in_enc => $in-><AG::ManakaiDOMInputFile.inputEncoding>, |
603 |
line => 1, |
line => 1, |
604 |
column => 1, |
column => 1, |
605 |
pos => 0, |
pos => 0, |
683 |
$r-><AS::Document.manakaiEntityBaseURI> |
$r-><AS::Document.manakaiEntityBaseURI> |
684 |
($self->{entity}->[0]->{base_uri}); |
($self->{entity}->[0]->{base_uri}); |
685 |
|
|
686 |
|
## Encoding name |
687 |
|
$r-><AS::Document.inputEncoding> ($self->{entity}->[0]->{in_enc}); |
688 |
|
|
689 |
## Document entity -> |Document| node |
## Document entity -> |Document| node |
690 |
$self->_parse_DocumentEntity; |
$self->_parse_DocumentEntity; |
691 |
|
|
15574 |
} |
} |
15575 |
} |
} |
15576 |
|
|
15577 |
|
@XMLTests: |
15578 |
|
@@QName: xp.byteStream.tests |
15579 |
|
|
15580 |
|
@@XMLTest: |
15581 |
|
@@@QName: xp.labeled.utf-8.test |
15582 |
|
@@@DEnt: |
15583 |
|
@@@@xp:encoding: utf-8 |
15584 |
|
@@@@test:value: |
15585 |
|
<p/> |
15586 |
|
@@@test:domTree: |
15587 |
|
document { |
15588 |
|
input-encoding: 'utf-8'; |
15589 |
|
xml-encoding: null; |
15590 |
|
element { |
15591 |
|
node-name: 'p'; |
15592 |
|
} |
15593 |
|
} |
15594 |
|
@@XMLTest: |
15595 |
|
@@@QName: xp.labeled.utf-16.be.test |
15596 |
|
@@@DEnt: |
15597 |
|
@@@@xp:encoding: utf-16 |
15598 |
|
@@@@test:value: |
15599 |
|
$u00FE$u00FF$u0000<$u0000p$u0000/$u0000> |
15600 |
|
@@@test:domTree: |
15601 |
|
document { |
15602 |
|
xml-encoding: null; |
15603 |
|
input-encoding: 'utf-16'; |
15604 |
|
element { |
15605 |
|
node-name: 'p'; |
15606 |
|
} |
15607 |
|
} |
15608 |
|
@@XMLTest: |
15609 |
|
@@@QName: xp.labeled.utf-16.le.test |
15610 |
|
@@@DEnt: |
15611 |
|
@@@@xp:encoding: utf-16 |
15612 |
|
@@@@test:value: |
15613 |
|
$u00FF$u00FE<$u0000p$u0000/$u0000>$u0000 |
15614 |
|
@@@test:domTree: |
15615 |
|
document { |
15616 |
|
xml-encoding: null; |
15617 |
|
input-encoding: 'utf-16'; |
15618 |
|
element { |
15619 |
|
node-name: 'p'; |
15620 |
|
} |
15621 |
|
} |
15622 |
|
@@XMLTest: |
15623 |
|
@@@QName: xp.labeled.utf-16.nobom.test |
15624 |
|
@@@DEnt: |
15625 |
|
@@@@xp:encoding: utf-16 |
15626 |
|
@@@@test:value: |
15627 |
|
<$u0000p$u0000/$u0000>$u0000 |
15628 |
|
@@@c:erred: <[[xp|fatal-utf-16-no-bom]]> {} |
15629 |
|
@@XMLTest: |
15630 |
|
@@@QName: xp.labeled.unknown.test |
15631 |
|
@@@DEnt: |
15632 |
|
@@@@xp:encoding: x-unknown-encoding-name |
15633 |
|
@@@@test:value: |
15634 |
|
<p/> |
15635 |
|
@@@c:erred: <[[xp|fatal-unprocessable-encoding]]> {} |
15636 |
|
@@XMLTest: |
15637 |
|
@@@QName: xp.unlabeled.encdecl.unknown.test |
15638 |
|
@@@DEnt: |
15639 |
|
@@@@test:value: |
15640 |
|
<?xml version="1.0" encoding="x-unknown-encoding-name"?> |
15641 |
|
<p/> |
15642 |
|
# @@@c:erred: <[[xp|fatal-unprocessable-encoding]]> {} |
15643 |
|
@@@c:erred: <[[xp|fatal-encoding-mismatch]]> {} |
15644 |
|
@@XMLTest: |
15645 |
|
@@@QName: xp.labeled.utf-8.illegal.test |
15646 |
|
@@@DEnt: |
15647 |
|
@@@@xp:encoding: utf-8 |
15648 |
|
@@@@test:value: |
15649 |
|
<p/$u00A0> |
15650 |
|
@@@c:erred: <[[xp|fatal-illegal-byte-sequence]]> {} |
15651 |
|
@@XMLTest: |
15652 |
|
@@@QName: xp.unlabeled.encdecl.utf-8.illegal.test |
15653 |
|
@@@DEnt: |
15654 |
|
@@@@test:value: |
15655 |
|
<?xml version="1.0" encoding="utf-8"?> |
15656 |
|
<p/$u00A0> |
15657 |
|
@@@c:erred: <[[xp|fatal-illegal-byte-sequence]]> {} |
15658 |
|
@@XMLTest: |
15659 |
|
@@@QName: xp.unlabeled.utf-8.illegal.test |
15660 |
|
@@@DEnt: |
15661 |
|
@@@@test:value: |
15662 |
|
<p/$u00A0> |
15663 |
|
@@@c:erred: <[[xp|fatal-illegal-byte-sequence]]> {} |
15664 |
|
@@XMLTest: |
15665 |
|
@@@QName: xp.mismatch.encdecl-as-utf-16.utf-8.test |
15666 |
|
@@@DEnt: |
15667 |
|
@@@@test:value: |
15668 |
|
<?xml version="1.0" encoding="utf-16"?> |
15669 |
|
<p/> |
15670 |
|
@@@c:erred: <[[xp|fatal-encoding-mismatch]]> {} |
15671 |
|
@@XMLTest: |
15672 |
|
@@@QName: xp.mismatch.labeled-as-utf-16.utf-8.test |
15673 |
|
@@@DEnt: |
15674 |
|
@@@@xp:encoding: utf-16 |
15675 |
|
@@@@test:value: |
15676 |
|
<p/> |
15677 |
|
@@@c:erred: <[[xp|fatal-utf-16-no-bom]]> {} |
15678 |
|
@@XMLTest: |
15679 |
|
@@@QName: xp.labeled-as-utf-8.encdecl-utf-16.test |
15680 |
|
@@@DEnt: |
15681 |
|
@@@@xp:encoding: utf-8 |
15682 |
|
@@@@test:value: |
15683 |
|
<?xml version="1.0" encoding="utf-16"?> |
15684 |
|
<p/> |
15685 |
|
@@@test:domTree: |
15686 |
|
document { |
15687 |
|
xml-encoding: 'utf-16'; |
15688 |
|
input-encoding: 'utf-8'; |
15689 |
|
element { } |
15690 |
|
} |
15691 |
|
|
15692 |
|
@@PerlDef: |
15693 |
|
my $impl = $Message::DOM::ImplementationRegistry->get_implementation ({ |
15694 |
|
'Core' => '3.0', |
15695 |
|
'XML' => '3.0', |
15696 |
|
'XMLVersion' => ['1.0', '1.1'], |
15697 |
|
}); |
15698 |
|
|
15699 |
|
for my $test_data (@$TestData) { |
15700 |
|
my $parser = <Class::ManakaiXMLParser>->new ($impl); |
15701 |
|
|
15702 |
|
$test->start_new_test ($test_data->{uri}); |
15703 |
|
my $doc_ent = $test_data->{entity}->{$test_data->{root_uri}}; |
15704 |
|
my $not_ok; |
15705 |
|
|
15706 |
|
## -- DOM Configuration Parameters |
15707 |
|
|
15708 |
|
my $pcfg = $parser->dom_config; |
15709 |
|
for (keys %{$test_data->{dom_config}}) { |
15710 |
|
$pcfg->set_parameter ($_ => $test_data->{dom_config}->{$_}); |
15711 |
|
} |
15712 |
|
|
15713 |
|
$pcfg->set_parameter ('error-handler' => sub ($$) { |
15714 |
|
my (undef, $err) = @_; |
15715 |
|
my $err_type = $err->type; |
15716 |
|
if ($test_data->{dom_error}->{$err_type}) { |
15717 |
|
$test->assert_error_equals |
15718 |
|
(actual_value => $err, |
15719 |
|
expected_hash => shift @{$test_data->{dom_error} |
15720 |
|
->{$err_type}}); |
15721 |
|
} else { # Uncatched error |
15722 |
|
warn $err; |
15723 |
|
unless ($err->severity == <C::c|DOMError.SEVERITY_WARNING>) { |
15724 |
|
$test->failure_comment ('Unexpected error |'.$err->type.'|'); |
15725 |
|
$not_ok = true; |
15726 |
|
} |
15727 |
|
} |
15728 |
|
return false; |
15729 |
|
}); |
15730 |
|
|
15731 |
|
## -- Input Data |
15732 |
|
|
15733 |
|
open my $byte, '<', \$doc_ent->{<Q::test|value>}; |
15734 |
|
my $input = {byte_stream => $byte, |
15735 |
|
system_id => $doc_ent->{<Q::test:uri>}, |
15736 |
|
base_uri => $doc_ent->{<Q::test:baseURI>}, |
15737 |
|
encoding => $doc_ent->{<Q::xp|encoding>}}; |
15738 |
|
|
15739 |
|
## -- Test and Result |
15740 |
|
|
15741 |
|
if ($test_data->{dom_tree}) { # Successful test |
15742 |
|
my $doc; |
15743 |
|
try { |
15744 |
|
$doc = $parser->parse ($input); |
15745 |
|
$test->assert_dom_tree_equals |
15746 |
|
(actual_value => $doc, |
15747 |
|
expected_hash => $test_data->{dom_tree}); |
15748 |
|
for (values %{$test_data->{dom_error}||{}}) { |
15749 |
|
if (@$_) { |
15750 |
|
$test->failure_comment |
15751 |
|
(@$_.' |DOMError|s of type |'. |
15752 |
|
$_->[0]->{type}->{value}.'| are not reported'); |
15753 |
|
$not_ok = true; |
15754 |
|
} |
15755 |
|
} |
15756 |
|
$not_ok ? $test->not_ok : $test->ok; |
15757 |
|
undef $doc; |
15758 |
|
} catch Message::Util::IF::DTException with { |
15759 |
|
require 'manakai/mndebug.pl'; |
15760 |
|
manakai::mndebug::dump ($doc); |
15761 |
|
} catch Message::DOM::IF::LSException with { |
15762 |
|
# not_ok |
15763 |
|
} otherwise { |
15764 |
|
my $err = shift; |
15765 |
|
warn $err; |
15766 |
|
$test->not_ok; |
15767 |
|
}; |
15768 |
|
} else { |
15769 |
|
my $doc; |
15770 |
|
try { |
15771 |
|
$doc = $parser->parse ($input); |
15772 |
|
} catch Message::Util::IF::DTException with { |
15773 |
|
require 'manakai/mndebug.pl'; |
15774 |
|
manakai::mndebug::dump ($doc); |
15775 |
|
} catch Message::DOM::IF::LSException with { |
15776 |
|
# |
15777 |
|
} otherwise { |
15778 |
|
my $err = shift; |
15779 |
|
warn $err; |
15780 |
|
$test->not_ok; |
15781 |
|
}; |
15782 |
|
for (values %{$test_data->{dom_error}||{}}) { |
15783 |
|
if (@$_) { |
15784 |
|
$test->failure_comment |
15785 |
|
(@$_.' |DOMError|s of type |'. |
15786 |
|
$_->[0]->{type}->{value}.'| are not reported'); |
15787 |
|
$not_ok = true; |
15788 |
|
} |
15789 |
|
} |
15790 |
|
$not_ok ? $test->not_ok : $test->ok; |
15791 |
|
} |
15792 |
|
} |
15793 |
|
|
15794 |
|
|
15795 |
@ResourceDef: |
@ResourceDef: |
15796 |
@@QName: getEmptyEntityState |
@@QName: getEmptyEntityState |
15797 |
@@rdf:type: DISPerl|InlineCode |
@@rdf:type: DISPerl|InlineCode |
16380 |
@@enDesc: |
@@enDesc: |
16381 |
The name of the attribute. |
The name of the attribute. |
16382 |
|
|
16383 |
|
FatalErrDef: |
16384 |
|
@QName: xp|fatal-illegal-byte-sequence |
16385 |
|
@enDesc: |
16386 |
|
An XML entity is determined to be in a certain encoding but |
16387 |
|
contains byte sequences that are not legal in that encoding. |
16388 |
|
@enMufDef: |
16389 |
|
Illegal byte sequence |
16390 |
|
@enImplNote: dump |
16391 |
|
@ecore:hasParameter: xp|byte-sequence |
16392 |
|
@ecore:hasParameter: xp|code-state |
16393 |
|
|
16394 |
|
XWParam: |
16395 |
|
@QName: xp|byte-sequence |
16396 |
|
@enDesc: |
16397 |
|
A reference to the byte string that contains an error. |
16398 |
|
|
16399 |
|
XWParam: |
16400 |
|
@QName: xp|code-state |
16401 |
|
@enDesc: |
16402 |
|
A string that identifies the state defined in the coded character set |
16403 |
|
in which an error is encoutnered. |
16404 |
|
|
16405 |
|
WarnDef: |
16406 |
|
@QName: xp|warning-unassigned-code-point |
16407 |
|
@enDesc: |
16408 |
|
If the entity contains an unassigned code point. |
16409 |
|
@enMufDef: |
16410 |
|
Unassigned code point found |
16411 |
|
@enImplNote: dump |
16412 |
|
@ecore:hasParameter: xp|byte-sequence |
16413 |
|
|
16414 |
|
FatalErrDef: |
16415 |
|
@QName: xp|fatal-unprocessable-encoding |
16416 |
|
@enDesc: |
16417 |
|
When an XML processor encounters an entity with an encoding |
16418 |
|
that is unable to process. |
16419 |
|
@enMufDef: |
16420 |
|
Encoding <%p (name => {<Q::xp|charset-uri>});> |
16421 |
|
%p (name => {<Q::xp|encoding>}, prefix => {(}, suffix => {) });is |
16422 |
|
not supported |
16423 |
|
@ecore:hasParameter: xp|encoding |
16424 |
|
@ecore:hasParameter: xp|charset-uri |
16425 |
|
|
16426 |
|
XWParam: |
16427 |
|
@QName: xp|encoding |
16428 |
|
@enDesc: |
16429 |
|
The XML name of the encoding. |
16430 |
|
@multipleProperties: DISCore|Single |
16431 |
|
@dataType: DISCore|String |
16432 |
|
@DISCore:resourceType: DISSource|ResourceProperty |
16433 |
|
|
16434 |
|
XWParam: |
16435 |
|
@QName: xp|charset-uri |
16436 |
|
@enDesc: |
16437 |
|
The URI that identifies the encoding. |
16438 |
|
|
16439 |
|
FatalErrDef: |
16440 |
|
@QName: xp|fatal-utf-16-no-bom |
16441 |
|
@enDesc: |
16442 |
|
If the encoding of an entity is UTF-16 but it does not |
16443 |
|
contains <CHAR::BOM>. |
16444 |
|
@enMufDef: |
16445 |
|
The entity contains no BOM |
16446 |
|
|
16447 |
|
FatalErrDef: |
16448 |
|
@QName: xp|fatal-encoding-mismatch |
16449 |
|
@enDesc: |
16450 |
|
If an entity including an encoding declaration |
16451 |
|
in an encoding other than that named in the declaration. |
16452 |
|
@enMufDef: |
16453 |
|
The entity is labeled as <%p (name => {<Q::xp|charset-uri>});> |
16454 |
|
%p (name => {<Q::xp|encoding>}, prefix => {(}, suffix => {) });but |
16455 |
|
it is wrong |
16456 |
|
@ecore:hasParameter: xp|encoding |
16457 |
|
@ecore:hasParameter: xp|charset-uri |
16458 |
|
|
16459 |
|
WarnDef: |
16460 |
|
@QName: xp|warn-unknown-decode-error |
16461 |
|
@enDesc: |
16462 |
|
Unknown message from the decoder. |
16463 |
|
@enMufDef: |
16464 |
|
Encoding decoder error: <%p (name => {<Q::xp|error-type>});> |
16465 |
|
@ecore:hasParameter: xp|error-type |
16466 |
|
@ecore:hasParameter: xp|error-param |
16467 |
|
|
16468 |
|
XWParam: |
16469 |
|
@QName: xp|error-type |
16470 |
|
@enDesc: |
16471 |
|
A DOM URI that identifies the error type. |
16472 |
|
|
16473 |
|
XWParam: |
16474 |
|
@QName: xp|error-param |
16475 |
|
@enDesc: |
16476 |
|
A <Q::xp|error-type>-dependent set of error descriptions. |
16477 |
|
|
16478 |
NSFatalErrDef: |
NSFatalErrDef: |
16479 |
@QName: xp|nswf-legal-ncname |
@QName: xp|nswf-legal-ncname |
16480 |
@enDesc: |
@enDesc: |
17071 |
@@@enDesc: |
@@@enDesc: |
17072 |
The default resolver. |
The default resolver. |
17073 |
@@@PerlDefC: |
@@@PerlDefC: |
17074 |
|
# resolveLSInput |
17075 |
$r = sub { |
$r = sub { |
17076 |
my ($self, $input, $errorHandler) = @_; |
my ($self, $impl, $input, $parser, $errorHandler) = @_; |
17077 |
## As defined in DOM Level 3 LS |LSInput| interface |
## As defined in DOM Level 3 LS |LSInput| interface |
17078 |
|
|
17079 |
my $r = {}; |
my $r = {}; |
17091 |
## 2. |byteStream| |
## 2. |byteStream| |
17092 |
$v = $input-><AG::LSInput.byteStream>; |
$v = $input-><AG::LSInput.byteStream>; |
17093 |
if (defined $v) { |
if (defined $v) { |
17094 |
## TODO: Support byte filehandle |
require Message::Charset::Encode; |
17095 |
## |encoding| |
my $mceimpl = $impl-><M::f|GetFeature.getFeature> |
17096 |
## TODO: How to guess? |
(<Q::fe|MCEncode>, '1.0'); |
17097 |
return null; |
my $encode = $input-><AG::LSInput.encoding>; |
17098 |
|
my $encode_uri = defined $encode |
17099 |
|
? $mceimpl-><M::mce|MCEncodeImplementation |
17100 |
|
.getURIFromCharsetName> |
17101 |
|
(<Q::cs|xmlName>, $encode) |
17102 |
|
: <Q::xml-auto-charset:>; |
17103 |
|
$r->{filehandle} = $mceimpl-><M::mce|MCEncodeImplementation |
17104 |
|
.createMCDecodeHandle> |
17105 |
|
($encode_uri, $v, sub { |
17106 |
|
my ($self, $fh, $type, %opt) = @_; |
17107 |
|
my $continue = true; |
17108 |
|
if ($type eq <Q::cs|illegal-octets-error>) { |
17109 |
|
$continue = __c|ERROR{xp|fatal-illegal-byte-sequence:: |
17110 |
|
xp|byte-sequence => {$opt{octets}}, |
17111 |
|
ecore|object => {$parser}, |
17112 |
|
}__; |
17113 |
|
} elsif ($type eq <Q::cs|unassigned-code-point-error>) { |
17114 |
|
$continue = __c|ERROR{xp|warning-unassigned-code-point:: |
17115 |
|
xp|byte-sequence => {$opt{octets}}, |
17116 |
|
ecore|object => {$parser}, |
17117 |
|
}__; |
17118 |
|
$opt{octets} = \"\x{FFFD}"; |
17119 |
|
} elsif ($type eq <Q::cs|invalid-state-error>) { |
17120 |
|
$continue = __c|ERROR{xp|fatal-illegal-byte-sequence:: |
17121 |
|
xp|code-state => {$opt{state}}, |
17122 |
|
ecore|object => {$parser}, |
17123 |
|
}__; |
17124 |
|
} elsif ($type eq <Q::cs|charset-not-supported-error>) { |
17125 |
|
$continue = __c|ERROR{xp|fatal-unprocessable-encoding:: |
17126 |
|
xp|encoding => {$encode}, |
17127 |
|
xp|charset-uri => {$opt{charset_uri}}, |
17128 |
|
ecore|object => {$parser}, |
17129 |
|
}__; |
17130 |
|
} elsif ($type eq <Q::cs|no-bom-error>) { |
17131 |
|
if ($opt{charset_uri} eq <Q::cs|XML.utf-16>) { |
17132 |
|
$continue = __c|ERROR{xp|fatal-utf-16-no-bom:: |
17133 |
|
ecore|object => {$parser}, |
17134 |
|
}__; |
17135 |
|
} else { |
17136 |
|
$continue = __c|ERROR{xp|fatal-illegal-byte-sequence:: |
17137 |
|
xp|code-state => 'bom', |
17138 |
|
ecore|object => {$parser}, |
17139 |
|
}__; |
17140 |
|
} |
17141 |
|
} elsif ($type eq <Q::cs|charset-name-mismatch-error>) { |
17142 |
|
$continue = __c|ERROR{xp|fatal-encoding-mismatch:: |
17143 |
|
xp|encoding => {$encode}, |
17144 |
|
xp|charset-uri => {$opt{charset_uri}}, |
17145 |
|
ecore|object => {$parser}, |
17146 |
|
}__; |
17147 |
|
} else { |
17148 |
|
$continue = __c|ERROR{xp|warn-unknown-decode-error:: |
17149 |
|
xp|error-type => {$type}, |
17150 |
|
xp|error-param => {\%opt}, |
17151 |
|
ecore|object => {$parser}, |
17152 |
|
}__; |
17153 |
|
} |
17154 |
|
unless ($continue) { |
17155 |
|
__EXCEPTION{DOMLS|PARSE_ERR:: |
17156 |
|
ecore|object => {$parser}, |
17157 |
|
}__; |
17158 |
|
} |
17159 |
|
}); |
17160 |
|
$r->{input_encoding} |
17161 |
|
= $r->{filehandle}-><AG::mce|MCDecodeHandle.inputEncoding> |
17162 |
|
if defined $r->{filehandle}; |
17163 |
|
last FH; |
17164 |
} |
} |
17165 |
|
|
17166 |
## 3. |stringData| |
## 3. |stringData| |
17219 |
} |
} |
17220 |
} # BURI |
} # BURI |
17221 |
|
|
17222 |
|
$r->{input_encoding} = $input-><AG::LSInput.encoding> |
17223 |
|
unless defined $r->{input_encoding}; |
17224 |
|
|
17225 |
}__; |
}__; |
17226 |
|
|
17227 |
## ISSUE: Is |certifiedText| required by parsers? |
## ISSUE: Is |certifiedText| required by parsers? |
17361 |
@@enDesc: |
@@enDesc: |
17362 |
Converts a <IF::LSInput> into a Perl filehandle. |
Converts a <IF::LSInput> into a Perl filehandle. |
17363 |
@@Param: |
@@Param: |
17364 |
|
@@@Name: impl |
17365 |
|
@@@Type: f|MinimumImplementation |
17366 |
|
@@@enDesc: |
17367 |
|
The implementation object. |
17368 |
|
@@Param: |
17369 |
@@@Name: input |
@@@Name: input |
17370 |
@@@Type: LSInput |
@@@Type: LSInput |
17371 |
@@@enDesc: |
@@@enDesc: |
17372 |
The input. |
The input. |
17373 |
@@Param: |
@@Param: |
17374 |
|
@@@Name: parser |
17375 |
|
@@@Type: LSParser |
17376 |
|
@@@enDesc: |
17377 |
|
The parser. |
17378 |
|
@@Param: |
17379 |
@@@Name: errorHandler |
@@@Name: errorHandler |
17380 |
@@@Type: c|DOMErrorHandler |
@@@Type: c|DOMErrorHandler |
17381 |
@@@enDesc: |
@@@enDesc: |
17395 |
} |
} |
17396 |
@@@PerlDef: |
@@@PerlDef: |
17397 |
__DEEP{ |
__DEEP{ |
17398 |
$r = $self->($self, $input, $errorHandler); |
$r = $self->($self, $impl, $input, $parser, $errorHandler); |
17399 |
}__; |
}__; |
17400 |
@@@enImplNote: |
@@@enImplNote: |
17401 |
Notet that the input / output processor for <CODE::$input> |
Notet that the input / output processor for <CODE::$input> |
17484 |
@@Set: |
@@Set: |
17485 |
@@@PerlDef: $self->{document_uri} = $given; |
@@@PerlDef: $self->{document_uri} = $given; |
17486 |
|
|
17487 |
|
@Attr: |
17488 |
|
@@Name: inputEncoding |
17489 |
|
@@enDesc: |
17490 |
|
The input encoding name. |
17491 |
|
@@Type: DOMString |
17492 |
|
@@nullCase: |
17493 |
|
@@@enDesc: |
17494 |
|
If the input encoding name is not available. |
17495 |
|
@@Get: |
17496 |
|
@@@PerlDef: $r = $self->{input_encoding}; |
17497 |
|
@@Set: |
17498 |
|
@@@PerlDef: $self->{input_encoding} = $given; |
17499 |
|
|
17500 |
@Method: |
@Method: |
17501 |
@@Name: close |
@@Name: close |
17502 |
@@enDesc: |
@@enDesc: |