71 |
http://suika.fam.cx/~wakaba/archive/2004/dom/tree# |
http://suika.fam.cx/~wakaba/archive/2004/dom/tree# |
72 |
@test: |
@test: |
73 |
http://suika.fam.cx/~wakaba/archive/2004/dis/Test# |
http://suika.fam.cx/~wakaba/archive/2004/dis/Test# |
74 |
|
@urigen: |
75 |
|
http://suika.fam.cx/~wakaba/archive/2005/manakai/URI/Generic/ |
76 |
@x: |
@x: |
77 |
http://suika.fam.cx/~wakaba/archive/2004/dom/xml# |
http://suika.fam.cx/~wakaba/archive/2004/dom/xml# |
78 |
@xml: |
@xml: |
640 |
<C::c|DOMError.SEVERITY_FATAL_ERROR>); |
<C::c|DOMError.SEVERITY_FATAL_ERROR>); |
641 |
}) |
}) |
642 |
unless $Message::DOM::XMLParser::DEBUG; |
unless $Message::DOM::XMLParser::DEBUG; |
643 |
## NOTE: The default error handler in manakai |wanr|s error |
## NOTE: The default error handler in manakai |warn|s error |
644 |
## description. |
## description. |
645 |
|
|
646 |
|
## Document entity's URI and base URI |
647 |
|
$r-><AS::Document.documentURI> ($self->{entity}->[0]->{doc_uri}); |
648 |
|
$r-><AS::Document.manakaiEntityBaseURI> |
649 |
|
($self->{entity}->[0]->{base_uri}); |
650 |
|
|
651 |
## Document entity -> |Document| node |
## Document entity -> |Document| node |
652 |
$self->_parse_DocumentEntity; |
$self->_parse_DocumentEntity; |
653 |
|
|
1415 |
|
|
1416 |
$pi = $doc-><M::Document.createProcessingInstruction> |
$pi = $doc-><M::Document.createProcessingInstruction> |
1417 |
($name); |
($name); |
1418 |
|
$pi-><AS::x|ProcessingInstruction.manakaiBaseURI> |
1419 |
|
($self->{location}->{base_uri}); |
1420 |
} |
} |
1421 |
} else { |
} else { |
1422 |
lang:Perl { |
lang:Perl { |
3360 |
|
|
3361 |
/* |
/* |
3362 |
System Identifier Literal Content |
System Identifier Literal Content |
3363 |
|
|
3364 |
|
Used in document type declaration, entity declaration, |
3365 |
|
and notation declaration. |
3366 |
*/ |
*/ |
3367 |
rule _SystemLiteral ($decl) { |
rule _SystemLiteral ($decl) { |
3368 |
// LIT or LITA |
// LIT or LITA |
3369 |
|
|
3370 |
~? (STRING) { |
~? (STRING) { |
3371 |
lang:Perl ($v => $token.value) { |
lang:Perl ($v => $token.value) { |
3372 |
## NOTE: Bare attribute name is written. |
$decl-><AS::x|Entity.systemId> ($v); |
3373 |
$decl->system_id ($v); |
$decl-><AS::x|Entity.manakaiDeclarationBaseURI> |
3374 |
|
($self->{location}->{base_uri}); |
3375 |
} |
} |
3376 |
} |
} |
3377 |
|
|
14735 |
} |
} |
14736 |
} |
} |
14737 |
|
|
14738 |
|
@@XMLTest: |
14739 |
|
@@@QName: xp.no.baseuri.test |
14740 |
|
@@@DEnt: |
14741 |
|
@@@@test:value: |
14742 |
|
<p/> |
14743 |
|
@@@test:domTree: |
14744 |
|
document { |
14745 |
|
document-uri: null; |
14746 |
|
base-uri: null; |
14747 |
|
element { |
14748 |
|
node-name: 'p'; |
14749 |
|
base-uri: null; |
14750 |
|
} |
14751 |
|
} |
14752 |
|
@@XMLTest: |
14753 |
|
@@@QName: xp.docuri.no.baseuri.test |
14754 |
|
@@@DEnt: |
14755 |
|
@@@@test:uri: |
14756 |
|
http://www.example.com/ |
14757 |
|
@@@@test:value: |
14758 |
|
<p/> |
14759 |
|
@@@test:domTree: |
14760 |
|
document { |
14761 |
|
document-uri: 'http://www.example.com/'; |
14762 |
|
base-uri: 'http://www.example.com/'; |
14763 |
|
element { |
14764 |
|
node-name: 'p'; |
14765 |
|
base-uri: 'http://www.example.com/'; |
14766 |
|
} |
14767 |
|
} |
14768 |
|
@@XMLTest: |
14769 |
|
@@@QName: xp.docuri.baseuri.test |
14770 |
|
@@@DEnt: |
14771 |
|
@@@@test:uri: |
14772 |
|
http://www.example.com/ |
14773 |
|
@@@@test:baseURI: |
14774 |
|
ftp://ftp.example.com/ |
14775 |
|
@@@@test:value: |
14776 |
|
<p/> |
14777 |
|
@@@test:domTree: |
14778 |
|
document { |
14779 |
|
document-uri: 'http://www.example.com/'; |
14780 |
|
base-uri: 'ftp://ftp.example.com/'; |
14781 |
|
element { |
14782 |
|
node-name: 'p'; |
14783 |
|
base-uri: 'ftp://ftp.example.com/'; |
14784 |
|
} |
14785 |
|
} |
14786 |
|
@@XMLTest: |
14787 |
|
@@@QName: xp.doctype.baseuri.test |
14788 |
|
@@@DEnt: |
14789 |
|
@@@@test:uri: |
14790 |
|
http://www.example.com/ |
14791 |
|
@@@@test:baseURI: |
14792 |
|
ftp://ftp.example.com/ |
14793 |
|
@@@@test:value: |
14794 |
|
<!DOCTYPE p SYSTEM "sys"> |
14795 |
|
<p/> |
14796 |
|
@@@test:domTree: |
14797 |
|
document { |
14798 |
|
document-uri: 'http://www.example.com/'; |
14799 |
|
base-uri: 'ftp://ftp.example.com/'; |
14800 |
|
document-type { |
14801 |
|
system-id: 'sys'; |
14802 |
|
manakai-declaration-base-uri: 'ftp://ftp.example.com/'; |
14803 |
|
} |
14804 |
|
element { |
14805 |
|
node-name: 'p'; |
14806 |
|
base-uri: 'ftp://ftp.example.com/'; |
14807 |
|
} |
14808 |
|
} |
14809 |
|
@@XMLTest: |
14810 |
|
@@@QName: xp.entdecl.baseuri.test |
14811 |
|
@@@DEnt: |
14812 |
|
@@@@test:uri: |
14813 |
|
http://www.example.com/ |
14814 |
|
@@@@test:baseURI: |
14815 |
|
ftp://ftp.example.com/ |
14816 |
|
@@@@test:value: |
14817 |
|
<!DOCTYPE p [ |
14818 |
|
<!ENTITY ent SYSTEM "ent"> |
14819 |
|
]> |
14820 |
|
<p/> |
14821 |
|
@@@test:domTree: |
14822 |
|
document { |
14823 |
|
document-uri: 'http://www.example.com/'; |
14824 |
|
base-uri: 'ftp://ftp.example.com/'; |
14825 |
|
document-type { |
14826 |
|
general-entity { |
14827 |
|
node-name: 'ent'; |
14828 |
|
manakai-declaration-base-uri: 'ftp://ftp.example.com/'; |
14829 |
|
} |
14830 |
|
} |
14831 |
|
element { |
14832 |
|
node-name: 'p'; |
14833 |
|
base-uri: 'ftp://ftp.example.com/'; |
14834 |
|
} |
14835 |
|
} |
14836 |
|
@@XMLTest: |
14837 |
|
@@@QName: xp.notdecl.baseuri.test |
14838 |
|
@@@DEnt: |
14839 |
|
@@@@test:uri: |
14840 |
|
http://www.example.com/ |
14841 |
|
@@@@test:baseURI: |
14842 |
|
ftp://ftp.example.com/ |
14843 |
|
@@@@test:value: |
14844 |
|
<!DOCTYPE p [ |
14845 |
|
<!NOTATION not SYSTEM "not"> |
14846 |
|
]> |
14847 |
|
<p/> |
14848 |
|
@@@test:domTree: |
14849 |
|
document { |
14850 |
|
document-uri: 'http://www.example.com/'; |
14851 |
|
base-uri: 'ftp://ftp.example.com/'; |
14852 |
|
document-type { |
14853 |
|
notation { |
14854 |
|
node-name: 'not'; |
14855 |
|
manakai-declaration-base-uri: 'ftp://ftp.example.com/'; |
14856 |
|
} |
14857 |
|
} |
14858 |
|
element { |
14859 |
|
node-name: 'p'; |
14860 |
|
base-uri: 'ftp://ftp.example.com/'; |
14861 |
|
} |
14862 |
|
} |
14863 |
|
@@XMLTest: |
14864 |
|
@@@QName: xp.doctype.intsubset.pi.baseuri.test |
14865 |
|
@@@DEnt: |
14866 |
|
@@@@test:uri: |
14867 |
|
http://www.example.com/ |
14868 |
|
@@@@test:baseURI: |
14869 |
|
ftp://ftp.example.com/ |
14870 |
|
@@@@test:value: |
14871 |
|
<!DOCTYPE p [ |
14872 |
|
<?pi?> |
14873 |
|
]> |
14874 |
|
<p/> |
14875 |
|
@@@test:domTree: |
14876 |
|
document { |
14877 |
|
document-uri: 'http://www.example.com/'; |
14878 |
|
base-uri: 'ftp://ftp.example.com/'; |
14879 |
|
document-type { |
14880 |
|
pi { |
14881 |
|
node-name: 'pi'; |
14882 |
|
base-uri: 'ftp://ftp.example.com/'; |
14883 |
|
} |
14884 |
|
} |
14885 |
|
element { |
14886 |
|
node-name: 'p'; |
14887 |
|
base-uri: 'ftp://ftp.example.com/'; |
14888 |
|
} |
14889 |
|
} |
14890 |
|
|
14891 |
@@PerlDef: |
@@PerlDef: |
14892 |
my $impl = $Message::DOM::ImplementationRegistry->get_implementation ({ |
my $impl = $Message::DOM::ImplementationRegistry->get_implementation ({ |
14893 |
'Core' => '3.0', |
'Core' => '3.0', |
16110 |
|
|
16111 |
my $v = $input-><AG::LSInput.systemId>; |
my $v = $input-><AG::LSInput.systemId>; |
16112 |
if (defined $v) { |
if (defined $v) { |
16113 |
$r->{document_uri} = $v; |
$r->{base_uri} = $input-><AG::LSInput.baseURI> |
16114 |
|
unless defined $r->{base_uri}; |
16115 |
|
if (defined $r->{base_uri}) { |
16116 |
|
$r->{document_uri} |
16117 |
|
= <ClassM::urigen|ManakaiURIReference.new> (\$v) |
16118 |
|
-><M::urigen|URIReference.getAbsoluteReference> |
16119 |
|
($r->{base_uri}) |
16120 |
|
-><AG::urigen|URIReference.uriReference>; |
16121 |
|
} else { |
16122 |
|
$r->{document_uri} = $v; |
16123 |
|
} |
16124 |
last DURI; |
last DURI; |
16125 |
} |
} |
16126 |
|
|
16210 |
my $sub3 = $cfg-><M::c|DOMConfiguration.getParameter> ($cp); |
my $sub3 = $cfg-><M::c|DOMConfiguration.getParameter> ($cp); |
16211 |
$test->assert_isa ($sub3, <ClassName::ManakaiDOMLSInputToInputFile>); |
$test->assert_isa ($sub3, <ClassName::ManakaiDOMLSInputToInputFile>); |
16212 |
$test->assert_equals ($sub3, $default); |
$test->assert_equals ($sub3, $default); |
16213 |
|
|
16214 |
|
@@Test: |
16215 |
|
@@@QName: cp.ls-input-to-input-file.default.test |
16216 |
|
@@@PerlDefC: |
16217 |
|
my $xp; |
16218 |
|
__CODE{createParserForTest:: $xp => $xp}__; |
16219 |
|
my $cfg = $xp-><AG::LSInput.domConfig>; |
16220 |
|
my $cp = <Q::xp|ls-input-to-input-file>; |
16221 |
|
my $default = $cfg-><M::c|DOMConfiguration.getParameter> ($cp); |
16222 |
|
|
16223 |
|
my $err = sub {}; # dummy error handler |
16224 |
|
|
16225 |
|
my $cs = \*STDOUT; # dummy input |
16226 |
|
|
16227 |
|
$test->id ('cs.sysid'); |
16228 |
|
my $r1 = $default->resolve_ls_input ({ |
16229 |
|
character_stream => $cs, |
16230 |
|
system_id => q<http://example.com/sysid>, |
16231 |
|
}, $err); |
16232 |
|
$test->assert_equals |
16233 |
|
($r1->document_uri, q<http://example.com/sysid>); |
16234 |
|
$test->assert_equals |
16235 |
|
($r1->base_uri, q<http://example.com/sysid>); |
16236 |
|
|
16237 |
|
$test->id ('cs.baseuri.sysid'); |
16238 |
|
my $r1 = $default->resolve_ls_input ({ |
16239 |
|
character_stream => $cs, |
16240 |
|
system_id => q<sysid>, |
16241 |
|
base_uri => q<http://example.com/>, |
16242 |
|
}, $err); |
16243 |
|
$test->assert_equals |
16244 |
|
($r1->document_uri, q<http://example.com/sysid>); |
16245 |
|
$test->assert_equals |
16246 |
|
($r1->base_uri, q<http://example.com/>); |
16247 |
##ls-input-to-input-file |
##ls-input-to-input-file |
16248 |
|
|
16249 |
ClsDef: |
ClsDef: |