-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDOM-Parsing-ja.html
More file actions
3829 lines (3522 loc) · 104 KB
/
Copy pathDOM-Parsing-ja.html
File metadata and controls
3829 lines (3522 loc) · 104 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html><html lang="ja"><head><meta charset="utf-8">
<title>DOM Parsing and Serialization (日本語訳)</title>
<link rel="stylesheet" href="common.css" type="text/css">
<link rel="stylesheet" href="common-w3c.css" type="text/css">
<script src="common0.js"></script>
<script src="common1.js" async></script>
<script>
Util.ready = function(){
const source_data = {
toc_main: 'MAIN0',
generate: expand,
};
Util.switchWordsInit(source_data);
}
function expand(){
const class_map = this.class_map;
const tag_map = this.tag_map;
const link_map = this.link_map;
return this.html.replace(
/%[\w\-~一-鿆あ-ん]+|`(.+?)([$@\^])(\w*)/g,
create_html
);
function create_html(match, key, indicator, klass){
if(!key) {//%
return `<var>${match.slice(1)}</var>`;
}
let href = '';
let href1 = '';
{
const n = key.indexOf('@');
if(n > 0) {
href1 = key.slice(n + 1);
key = key.slice(0, n);
}
}
let text = key;
switch(klass){
case 'r':
text = `[${key}]`;
href = `#bib-${key}`;
break;
case 'm':
const n = text.indexOf('(');
if(n > 0){
key = text.slice(0, n);
text = key + text.slice(n).replace(/\w+/g, '<var>$&</var>');
}
break;
case 'l':
return `"<code class="literal">${text}</code>"`;
break;
case 'U':
text = `<span class="code-point">U+${key}</span>`;
if( key > '0020' ) {
text += ` (<span class="char-symbol">&#x${key};</span>)`;
}
break;
case 'srz':
text = `<code>${key}</code> ~nodeを~XMLに直列化する`;
break;
case 'en':
text = `<span lang="en">${key}</span>`;
break;
}
let tag = tag_map[klass];
if(tag) {
let classname = class_map[klass];
classname = classname ? ` class="${classname}"` : '';
text = `<${tag}${classname}>${text}</${tag}>`;
}
if(indicator !== '^'){
href = href1 || link_map[ klass ? `${klass}.${key}` : key ] || href;
if(!href){
console.log(match); // check error
return match;
}
switch(indicator){
case '$':
text = `<a href="${href}">${text}</a>`;
break;
case '@':
text = `<dfn id="${href.slice(1)}">${text}</dfn>`;
break;
}
}
return text;
}
}
</script>
<script type="text/plain" id="_source_data">
●●options
spec_date:2026-09-02
trans_update:2026-09-13
source_checked:260902
original_url:https://w3c.github.io/DOM-Parsing/
spec_status:ED
ref_id_prefix:bib-
copyright:2026,permissive
trans_1st_pub:2017-08-03
●●class_map
E:error
P:production
v:value
e:element
a:attr
U:code-point
cn:cp-name
●●tag_map
I:code
E:code
m:code
mA:code
P:code
e:code
a:code
c:code
U:span
i:i
v:code
V:var
cn:span
em:em
cite:cite
●●words_table1
SPACE:<span class="code-point">U+0020</span> <span class="cp-name">SPACE</span>
XML10:https://www.w3.org/TR/xml/
XNLNS10:xml-names-ja.html
●●words_table
●名称/略称
XMLNS:
XHTML:
Edge
Firefox
Safari
Chrome
●markup/ns/構文/直列化
ns:namespace:::名前空間
有修飾:qualified::~
void:
整形式:well-formed::~
未宣言に:undeclare::~
宣言し直-:redeclare
●変数
%~node:node
%整形式が要求されるか:require well-formed
%~ns:ns
%~ns:namespace
%~ns:namespace definition
%継承された~ns:inherited ns
%継承された~ns:namespace
%局所的な既定の~ns:local default ns
%属性~ns:attribute namespace
%新たな~ns:new ns
%~map:map
%局所~接頭辞~map:local prefixes map
%接頭辞:prefix
%接頭辞:prefix definition
%接頭辞~map:prefix map
%接頭辞~index:prefix index
%候補~接頭辞:candidate prefix
%属性~接頭辞:attribute prefix
%選好される接頭辞:preferred prefix
%生成された接頭辞:generated prefix
%接頭辞~list:candidates
-:candidates
%~markup:markup
%有修飾~名:qualified name
-:skip end tag
%~ns定義~属性を無視するか:ignore ns definition attribute
%子:child
%複製:copy
%~key:key
%値:value
%既定の~ns属性~値:default namespace attr value
%属性:attr
%要素:element
%~ns定義~属性を無視するか:ignore ns definition attribute
%結果:result
%局所~名~集合:localname set
%局所~名:-
%属性~値:-
%属性~名:attrName
%属性~値:attribute value
%直列化された文書:serialized document
%~ID:id
%引用符:q
-:map value
●仕様
昇格基準:exit criteria:~
理想的:ideal:~
一律:uniform:~
単体的:monolithic:~
合法:legal:~
正当:legitimate:~
競合-:conflict:~
proprietary::::プロプライエタリ
衝突:clash:~
矛盾-:contradict:~
中立的:neutral:~
拠所:resort:~
為され:makeされ:~
要約-:summary
〜得る:possible
^en:qualifications
flavor
込み入って:tricky
規範的でない:informative
謝意:thank
に感謝:acknowledge with gratitude
より深い:greater
かまわない:OK
従う:as follows
編成し直-:Editorial restructuring
-:assume
~~悪化-:reduce
利用者~~層の細分化を招く:fragments the user base
より旧い:older
したとする:suppose
~~考えて:think
~test事例:testcase
●未分類
連結:concatenation::~
連結-:concatenate::~
遭遇-:encounter:~
代用-:substitute:~
~~代用され:substitute
生残る:surviveする:生き残る
同一性:identity:~
候補:candidate:~
近過去:recent:~
template:
変形-:transform::~
~tuple:pair
渡-:pass
-:conditional
-:visit
~memory内:in-memory
-:label
予約-済み:reserved
既存のものを置換する:replacement
出くわした:seen
見られる:seen
失われ:loss
近くなる:get closer
見せかけた:made to look like
この時点で/:At this point
-:furthermore
-:any occurrences of
WHATWG
-:current numerical value of
-:respective
-:go
並び:adjacent
より早く:earlier
次:next
様々:various
他方:wereas
任意個数の:any number
以下の:at most
以前に:previously
前回/-:previous
最終的に:end up
-:sub-step
前~段:the step labelled ...
~~末端:leaf
-:respective
-:a mutable reference to
-:exactly
-:WPT
●●original_id_map
■旧 id
dom-domparser:dom-domparser-parsefromstring
dom-domparser:idl-def-supportedtype
dom-domparser:dom-supportedtype-text/html
dom-domparser:dom-supportedtype-text/xml
dom-domparser:dom-supportedtype-application/xml
dom-domparser:dom-supportedtype-application/xhtml+xml
dom-domparser:dom-supportedtype-image/svg+xml
dom-xmlserializer:dom-xmlserializer-constructor
dom-xmlserializer:dom-xmlserializer-serializetostring
●●mdn_urls
xmlserializer:API/XMLSerializer
●●link_map
●IDL
E.TypeError:~WEBIDL#exceptiondef-typeerror
E.InvalidStateError:~WEBIDL#invalidstateerror
I.Attr:~DOM4#attr
I.Comment:~DOM4#comment
I.Document:~DOM4#document
I.DocumentFragment:~DOM4#documentfragment
I.DocumentType:~DOM4#documenttype
I.Element:~DOM4#element
I.Node:~DOM4#node
I.ProcessingInstruction:~DOM4#processinginstruction
I.Text:~DOM4#text
I.CDATASection:~DOM4#cdatasection
I.Range:~DOM4#range
m.innerHTML:~HTMLdynamic#dom-element-innerhtml
#dfn-innerhtml
@~HTMLdynamic#dom-element-outerhtml
#dfn-outerhtml
@~DOM4#dom-element-setattribute
@~HTMLdynamic#dom-element-insertadjacenthtml
#dfn-insertadjacenthtml
@~HTMLdynamic#dom-xmlserializer-constructor
@~HTMLdynamic#dom-xmlserializer-serializetostring
e.script:~HEscripting#the-script-element
e.script:~HEscripting#script
e.template:~HEscripting#the-template-element
P.AttValue:~XML10#NT-AttValue
P.AttValue:#dfn-attvalue
P.Char:~XML10#NT-Char
P.Char:#dfn-char
P.EmptyElemTag:~XML10#NT-EmptyElemTag
P.EmptyElemTag:#dfn-emptyelemtag
P.Name:~XML10#NT-Name
P.Name:#dfn-name
P.PubidChar:~XML10#NT-PubidChar
P.PubidChar:#dfn-pubidchar
●用語
構文解析:#dfn-parsing
直列化-:#dfn-serializing
~XML直列化:#dfn-xml-serialization
往復-:#dfn-round-tripping
属性~値を直列化する:#dfn-serializing-an-attribute-value
~IDを直列化する:#dfn-serialization-of-the-id
~nodeを~XMLに直列化する:#dfn-xml-serialization-algorithm
要素の属性たちを~XMLに直列化する:#dfn-xml-serialization-of-the-attributes
srz.Element:#dfn-xml-serializing-an-element-node
srz.Document:#dfn-xml-serializing-a-document-node
srz.Comment:#dfn-xml-serializing-a-comment-node
srz.CDATASection:#dfn-xml-serializing-a-cdatasection-node
srz.Text:#dfn-xml-serializing-a-text-node
srz.DocumentFragment:#dfn-xml-serializing-a-documentfragment-node
srz.DocumentType:#dfn-xml-serializing-a-documenttype-node
srz.ProcessingInstruction:#dfn-xml-serializing-a-processinginstruction-node
~ns接頭辞~map:#dfn-namespace-prefix-map
整形式~性~error:#dfn-throw-an-exception
#_well-formedness-error
接頭辞~list:#_namespace-prefix-list
~ns接頭辞~宣言:#_namespace-prefix-declaration
既定の~ns宣言:#_default-namespace-declaration
接頭辞が見出されるか否か:#dfn-found
~ns接頭辞~mapを複製する:#dfn-copy-a-namespace-prefix-map
接頭辞を生成する:#dfn-generating-a-prefix
接頭辞~mapに追加する:#dfn-add
要素の~ns情報を記録する:#dfn-recording-the-namespace-information
選好される接頭辞~文字列を検索取得する:#dfn-retrieving-a-preferred-prefix-string
V.接頭辞~index:#dfn-prefix-index
V.整形式が要求されるか:#dfn-require-well-formed
#dfn-found-a-suitable-namespace-prefix
#issue-container-number-...
#issue-container-generatedID
#a-dependencies
#b-revision-history
#c-acknowledgements
●用語(DOM
~node:~DOM4#concept-node
文書:~DOM4#concept-document
~HTML文書:~DOM4#html-document
doc.種別:~DOM4#concept-document-type
広義-先祖:~DOM4#concept-tree-inclusive-ancestor
属性:~DOM4#concept-attribute
A.値:~DOM4#concept-attribute-value
A.~ns:~DOM4#concept-attribute-namespace
A.~ns接頭辞:~DOM4#concept-attribute-namespace-prefix
A.局所~名:~DOM4#concept-attribute-local-name
A.有修飾~名:~DOM4#concept-attribute-qualified-name
mA.name
要素:~DOM4#concept-element
属性~list:~DOM4#concept-element-attribute
eL.~ns接頭辞:~DOM4#concept-element-namespace-prefix
eL.~ns:~DOM4#concept-element-namespace
eL.局所~名:~DOM4#concept-element-local-name
doctype:#dfn-doctype
:~DOM4#dom-document-doctype
dT.名前:~DOM4#concept-doctype-name
dT.公な~ID:~DOM4#concept-doctype-publicid
dT.~system~ID:~DOM4#concept-doctype-systemid
~data:~DOM4#concept-cd-data
pI.~target:~DOM4#concept-pi-target
文書~要素:~DOM4#document-element
子:~DOM4#concept-tree-child
子~群:~DOM4#concept-tree-child
~tree順序:~DOM4#concept-tree-order
●用語(他
文字列:~INFRA#string
~ASCII大小無視:~INFRA#ascii-case-insensitive
~list:~INFRA#list
~cloneする:~INFRA#list-clone
空:~INFRA#list-is-empty
~size:~INFRA#list-size
付加する:~INFRA#list-append
有順序~集合:~INFRA#ordered-set
set.付加する:~INFRA#set-append
有順序~map:~INFRA#ordered-map
~tuple:~INFRA#tuple
~HTML~ns:~INFRA#html-namespace
~XML~ns:~INFRA#xml-namespace
~XMLNS~ns:~INFRA#xmlns-namespace
~NEQ ε:~INFRA#map-exists
~SET:~INFRA#map-set
~EACH:~INFRA#list-iterate
~CONTINUE:~INFRA#iteration-continue
map.~EACH:~INFRA#map-iterate
~Assert:~INFRA#assert
~IN:~INFRA#list-contain
~template内容:~HEscripting#template-contents
~template内容:#dfn-template-content
~HTML構文解析器:~HTMLparsing#html-parser
#dfn-html-parser
~XML構文解析器:~HTMLxml#xml-parser
#xml-parser
~void要素:~HTMLwriting#void-elements
@~HTMLxml#parsing-xhtml-documents
#dfn-parsing-xhtml-documents
空~要素~tag:~XML10#dt-eetag
空~要素~tag:#dfn-empty-element-tag
●●ref_normative
[DOM]
<DOM Standard>. Anne van Kesteren. WHATWG. Living Standard. URL: https://dom.spec.whatwg.org/
[ECMA-262]
<ECMAScript Language Specification>. Ecma International. URL: https://tc39.es/ecma262/multipage/
[HTML]
<HTML Standard>. Anne van Kesteren; Domenic Denicola; Dominic Farolino; Ian Hickson; Philip Jägenstedt; Simon Pieters. WHATWG. Living Standard. URL: https://html.spec.whatwg.org/multipage/
[INFRA]
<Infra Standard>. Anne van Kesteren; Domenic Denicola. WHATWG. Living Standard. URL: https://infra.spec.whatwg.org/
[WEBIDL]
<Web IDL Standard>. Edgar Chen; Timothy Gu. WHATWG. Living Standard. URL: https://webidl.spec.whatwg.org/
[XML10]
<Extensible Markup Language (XML) 1.0 (Fifth Edition)>. Tim Bray; Jean Paoli; Michael Sperberg-McQueen; Eve Maler; François Yergeau et al. W3C. 26 November 2008. W3C Recommendation. URL: https://www.w3.org/TR/xml/
●●ref_additional
[XMLNS]
<Namespaces in XML>, T. Bray, D. Hollander, A. Layman, R. Tobin. W3C.
URL: https://www.w3.org/TR/xml-names/
●●trans_metadata
<p>
~THIS_PAGEは、~W3Cにより編集者草案として公開された
<a href="~SPEC_URL">DOM Parsing and Serialization</a>
を日本語に翻訳したものです。
~PUB
</p>
●●spec_metadata
最新公表バージョン
https://www.w3.org/TR/DOM-Parsing/
公表履歴
https://www.w3.org/standards/history/DOM-Parsing/
commit 履歴
https://github.com/w3c/DOM-Parsing/commits/
編集
<a href="mailto:travis.leithead@microsoft.com">Travis Leithead</a> (Microsoft)
フィードバック
<a href="https://github.com/w3c/DOM-Parsing/">GitHub w3c/DOM-Parsing</a> (<a href="https://github.com/w3c/DOM-Parsing/pulls/">pull requests</a>, <a href="https://github.com/w3c/DOM-Parsing/issues/new/choose">new issue</a>, <a href="https://github.com/w3c/DOM-Parsing/issues/">open issues</a>)
テスト一式
http://wpt.live/domparsing/
http://wpt.live/html/syntax/
Participate
<a href="https://www.w3.org/Bugs/Public/buglist.cgi?component=DOM%20Parsing%20and%20Serialization&list_id=44989&product=WebAppsWG&resolution=---">Bugzilla Bug list.</a>
<a href="https://lists.w3.org/Archives/Public/www-dom/">Mailing list.</a>
公表者
<a href="https://www.w3.org/groups/wg/webapps">Web Applications WG</a>
</script>
</head>
<body>
<header>
<hgroup>
<h1>DOM の構文解析と直列化 — DOM Parsing and Serialization</h1>
<p title="DOMParser, XMLSerializer, innerHTML, and similar APIs"><code >DOMParser</code>, <code>XMLSerializer</code>, <code>innerHTML</code> などの API</p>
</hgroup>
</header>
<div id="MAIN" hidden>
<section id="abstract">
◎要約
<p>
この仕様は、
~web~app用に,[
~HTML/~XML
]に基づく~DOM~nodeを[
構文解析する, 直列化する
]ための~APIを定義する。
◎
This specification defines APIs for the parsing and serializing of HTML and XML-based DOM nodes for web applications.
</p>
<p class="trans-note">【
と述べられているが、
~XML直列化~algo以外は,`~HTML標準へ移動された@#apis-for-parsing-and-serializing-dom$。
】</p>
</section>
<section id="sotd">
◎位置付け
<p>
これは、
編集者草案の公な複製です…
【以下,この節を成す他の内容は、~SOTD-W3Cに移譲。】
</p>
</section>
<main id="MAIN0">
<section id="_conventions">
<h2>【この訳に特有な表記規約】</h2>
◎表記記号
</section>
<section id="crec">
<h2 title="Candidate Recommendation Exit Criteria">勧告候補からの昇格基準</h2>
<p>
【この節を成す内容の和訳は省略する。】
◎
This specification will not advance to Proposed Recommendation before the spec's test suite is completed and two or more independent implementations pass each test, although no single implementation must pass each test. We expect to meet this criteria no sooner than 24 October 2014. The group will also create an Implementation Report.
</p>
</section>
<section id="conformance">
<h2 title="Conformance">1. 適合性</h2>
<p class="trans-note">【
この節を成す他の内容は、
<a href="~W3Ccommon#w3c-conformance">~W3C日本語訳 共通~page</a>に移譲。
】</p>
<p>
この仕様は `INFRA$r に依存する。
◎
This specification depends on the Infra Standard. [INFRA]
</p>
</section>
<section id="extensibility">
<h2 title="Extensibility">2. 拡張能</h2>
<p>
この仕様に対する~vendorに特有な~proprietaryな拡張は、
強く忌避される。
作者は、
そのような拡張を利用してはナラナイ。
そのような行為は、
当の内容への~accessが特定の~UAの利用者に限られてしまい,
相互運用能の~~悪化と利用者~~層の細分化を招くことになるので。
◎
Vendor-specific proprietary extensions to this specification are strongly discouraged. Authors must not use such extensions, as doing so reduces interoperability and fragments the user base, allowing only users of specific user agents to access the content in question.
</p>
<p>
~vendorに特有な拡張が必要な場合、
この仕様を成す将来の~versionとの衝突を防止するため,
【当の~APIを成す】各~memberには~vendorに特有な文字列が接頭されなければナラナイ。
拡張は、
その利用が,この仕様にて定義される機能性に[
矛盾する/適合しなくなる
]ように定義されてはナラナイ。
◎
If vendor-specific extensions are needed, the members should be prefixed by vendor-specific strings to prevent clashes with future versions of this specification. Extensions must be defined so that the use of extensions neither contradicts nor causes the non-conformance of functionality defined in the specification.
</p>
<p>
この仕様に対し ~vendorに中立的な拡張が必要になったときは、[
それに則って,この仕様が更新される
]こともあれば[
この仕様の要件を上書きする拡張~仕様が記される
]こともある。
そのような仕様は、
この仕様に対する適合性~要件の目的において,適用-可能な仕様になる。
◎
When vendor-neutral extensions to this specification are needed, either this specification can be updated accordingly, or an extension specification can be written that overrides the requirements in this specification. Such an extension specification becomes an applicable specification for the purposes of conformance requirements in this specification.
</p>
</section>
<section id="introduction">
<h2 title="Introduction">3. 序論</h2>
<p>
~DOM(文書~obj~model)は、
各自が~treeに接続されている様々な型の `Node$I たちが成す,~memory内~表現である。
~DOMと その `Node$I のより深い詳細は、
`HTML$r および `DOM4$r 仕様に述べられる。
◎
A document object model (DOM) is an in-memory representation of various types of Nodes where each Node is connected in a tree. The [HTML] and [DOM] specifications describe DOM and its Nodes in greater detail.
</p>
<p>
用語[
`構文解析@
は,
~DOMの文字列~表現を実際の~DOMへ変換するとき/
`直列化-@
は,~DOMを文字列へ変形して戻すとき
]に利用される用語である。
この仕様~自身は、
~DOMを[
構文解析する/直列化する
]ための各種~APIを定義することを扱う。
◎
Parsing is the term used for converting a string representation of a DOM into an actual DOM, and Serializing is the term used to transform a DOM back into a string. This specification concerns itself with defining various APIs for both parsing and serializing a DOM.
</p>
<div class="example">
<p>
例えば, `Element$I の `innerHTML$m ~APIは、[
~DOMを直列化する/~DOMに構文解析する
]共通的な仕方を与える
(それは、
この両方とも行える)。
特定0の `Node$I の~memory内~DOMが次であったとする:
◎
For example: the Element.innerHTML API is a common way to both parse and serialize a DOM (it does both). If a particular Node has the following in-memory DOM:
</p>
<div>
<ol><li>`HTMLDivElement^I ( `nodeName^m ~EQ `div^l )
<ol><li>`HTMLSpanElement^I ( `nodeName^m ~EQ `span^l)
<ol><li>`Text^I ( `data^m ~EQ `ある^l )
</li></ol>
</li><li>`HTMLElement^I ( `nodeName^m ~EQ `em^l )
<ol><li>`Text^I ( `data^m ~EQ `文章。^l )
</li></ol>
</li></ol>
</li></ol>
<pre lang="en" class="_en">
HTMLDivElement (nodeName: "div")
┃
┣━ HTMLSpanElement (nodeName: "span")
┃ ┃
┃ ┗━ Text (data: "some ")
┃
┗━ HTMLElement (nodeName: "em")
┃
┗━ Text (data: "text!")
</pre>
</div>
<p>
`HTMLDivElement^I ~nodeの子~群を直列化するためには、
単純に `Element$I の `innerHTML$m ~propを`取得する^em(読取る)
(これは、
直列化を誘発する):
◎
And the HTMLDivElement node is stored in a variable myDiv, then to serialize myDiv's children simply get (read) the Element.innerHTML property (this triggers the serialization):
</p>
<pre class="lang-js">
var %myDiv = /* <span class="comment">
ある `HTMLDivElement^I ~node
</span> */
var %serializedChildren = %myDiv.innerHTML;
/* <span class="comment">
結果は `<span>ある</span><em>文章。</em>^l になる。
◎
// serializedChildren has the value:
// "<span>some </span><em>text!</em>"
</span>
</pre>
<p>
文字列から
%myDiv 用の(その既存の子たちを置換して)新たな子を構文解析するためには、
単純に `innerHTML$m ~propを`設定する^em
(これは、
アテガわれた文字列の構文解析を誘発する):
◎
To parse new children for myDiv from a string (replacing its existing children), simply set the Element.innerHTML property (this triggers parsing of the assigned string):
</p>
<pre class="lang-js">
%myDiv.innerHTML = `<span>new</span><em>children!</em>^l;
</pre>
</div>
<p>
[
~HTML / ~XML( ~XHTMLは~XMLの一種である)
]における[
`構文解析$, `直列化-$
]は、
各自の~markup言語の規則に従う。
上の例は,~HTMLの[
構文解析/直列化
]を示しているが、
それらに特有な~algoは `HTML$r 仕様に定義される。
この仕様は、
~XMLを直列化するための~algoを与える。
~XMLを構文解析するための文法は、
`XML10$r 仕様に述べられる。
◎
This specification describes two flavors of parsing and serializing: HTML and XML (with XHTML being a type of XML). Each follows the rules of its respective markup language. The above example shows HTML parsing and serialization. The specific algorithms for HTML parsing and serializing are defined in the [HTML] specification. This specification contains the algorithm for XML serializing. The grammar for XML parsing is described in the [XML10] specification.
</p>
<p>
`往復-@
するとは、
~DOMを直列化した結果の文字列を,即時に構文解析して~DOMに戻す
【または、そうしたときに元と同じに保たれる】
ことを意味する。
理想的には、
この処理nによる結果の~DOM内のどの `Node$I においても,その属性の~dataは失われることなく同一性が保たれるべきである。
が,~XMLにおいて`往復-$することは、
直列化しても `Node$I の~nsの同一性が保全されるよう配慮しなければナラナイ点で,
とりわけ込み入っている
(他方、
~HTMLにおいては,~nsは無視される)。
◎
Round-tripping a DOM means to serialize and then immediately parse the serialized string back into a DOM. Ideally, this process does not result in any data loss with respect to the identity and attributes of the Node in the DOM. Round-tripping is especially tricky for an XML serialization, which must be concerned with preserving the Node's namespace identity in the serialization (wereas namespaces are ignored in HTML).
</p>
<div class="example">
<p>
次の~memory内~DOMに対する~XML直列化を考える:
◎
Consider the XML serialization of the following in-memory DOM:
</p>
<div>
<ol><li>`Element^I ( `nodeName^m ~EQ `root^l )
<ol><li>`HTMLScriptElement^I ( `nodeName^m ~EQ `script^l)
<ol><li>`Text^I ( `data^m ~EQ `alert('hello world') ^l )
</li></ol>
</li></ol>
</li></ol>
<pre lang="en" class="_en">
Element (nodeName: "root")
┃
┗━ HTMLScriptElement (nodeName: "script")
┃
┗━ Text (data: "alert('hello world')")
</pre>
</div>
<p>
`script$e 要素の同一性を保全するため、[
~XML直列化は,当の要素( `HTMLScriptElement@~HEscripting#htmlscriptelement$I )の`~ns$eLを含むこと
]および[
直列化された文字列は、
`~XML構文解析器$を通して`往復-$すること
]を許容しなければナラナイ。
上の `root^l 要素が変数 %root に格納されたと見做す下で,
次のように~XMLに直列化されたなら:
◎
An XML serialization must include the HTMLScriptElement's namespace in order to preserve the identity of the script element, and to allow the serialized string to round-trip through an XML parser. Assuming that root is in a variable named root:
</p>
<pre class="lang-js">
var %xmlSerialization = `new XMLSerializer()@~HTMLdynamic#dom-xmlserializer-constructor$m.`serializeToString(root)@~HTMLdynamic#dom-xmlserializer-serializetostring$m;
</pre>
<p>
結果は
⇒
`<root><script xmlns="http://www.w3.org/1999/xhtml">alert('hello world')</script></root>^l
◎
// xmlSerialization has the value:
// "<root><script xmlns="http://www.w3.org/1999/xhtml">alert('hello world')</script></root>"
</p>
</div>
</section>
<section id="apis-for-parsing-and-serializing-dom">
<h2 title="APIs for parsing and serializing DOM">4. ~DOMを構文解析する/直列化するための~API</h2>
<section id="the-domparser-interface">
<h3 title="The DOMParser interface">4.1. `DOMParser^I ~interface</h3>
<p id="dom-domparser">
`DOMParser@~HTMLdynamic#domparser$I
の定義は、
`~HTML標準@~HTMLdynamic#the-domparser-interface$へ移動された。
◎
The definition of DOMParser has moved to the HTML Standard.
</p>
</section>
<section id="the-xmlserializer-interface">
<h3 title="The XMLSerializer interface">4.2. `XMLSerializer^I ~interface</h3>
<p id="dom-xmlserializer">
`XMLSerializer@~HTMLdynamic#xmlserializer$I
の定義は、
`~HTML標準@~HTMLdynamic#the-xmlserializer-interface$へ移動された。
◎
The definition of XMLSerializer has moved to the HTML Standard.
</p>
</section>
<section id="the-innerhtml-mixin">
<h3 title="The InnerHTML mixin">4.3. `InnerHTML^I ~mixin</h3>
<p class="trans-note">【
`InnerHTML^I ~interface~mixinは除去され,
その `innerHTML^m は `Element^I へ移動された。
】</p>
<p id="dom-innerhtml">
`Element$I の `innerHTML$m の定義は、
`~HTML標準@~HTMLdynamic#the-innerhtml-property$へ移動された。
◎
The definition of Element.innerHTML has moved to the HTML Standard.
</p>
</section>
<section id="extensions-to-the-element-interface">
<h3 title="Extensions to the Element interface">4.4. `Element$I ~interfaceに対する拡張</h3>
<p id="dom-element-outerhtml">
`outerHTML@~HTMLdynamic#dom-element-outerhtml$m
の定義は、
`~HTML標準@~HTMLdynamic#the-outerhtml-property$へ移動された。
◎
The definition of Element.outerHTML has moved to the HTML Standard.
</p>
<p id="dom-element-insertadjacenthtml">
`insertAdjacentHTML@~HTMLdynamic#dom-element-insertadjacenthtml$m
の定義は、
`~HTML標準@~HTMLdynamic#the-insertadjacenthtml()-method$へ移動された。
◎
The definition of Element.insertAdjacentHTML has moved to the HTML Standard.
</p>
</section>
<section id="extensions-to-the-range-interface">
<h3 title="Extensions to the Range interface">4.5. `Range$I ~interfaceに対する拡張</h3>
<p id="dom-range-createcontextualfragment">
`createContextualFragment@~HTMLdynamic#dom-range-createcontextualfragment$m
の定義は、
`~HTML標準@~HTMLdynamic#the-createcontextualfragment()-method$へ移動された。
◎
The definition of Range.createContextualFragment() has moved to the HTML Standard.
</p>
</section>
</section>
<section id="algorithms-for-parsing-and-serializing">
<h2 title="Algorithms for parsing and serializing">5. 素片~用の構文解析-法と直列化-法</h2>
<section id="parsing">
<h3 title="Parsing">5.1. 構文解析-法</h3>
<p id="dfn-fragment-parsing-algorithm">
素片を構文解析する~algoの定義は、
`~HTML標準@~HTMLdynamic#fragment-parsing-algorithm-steps$へ移動された。
◎
The definition of fragment parsing algorithm has moved to the HTML Standard.
</p>
</section>
<section id="serializing">
<h3 title="Serializing">5.2. 直列化-法</h3>
<p id="dfn-fragment-serializing-algorithm">
素片に直列化する~algoの定義は、
`~HTML標準@~HTMLdynamic#fragment-serializing-algorithm-steps$へ移動された。
◎
The definition of fragment serializing algorithm has moved to the HTML Standard.
</p>
</section>
</section>
<section id="xml-serialization">
<h2 title="XML Serialization">6. ~XML直列化</h2>
<p class="trans-note">【
この節は,原文では § 5.2 の下位節として与えられているが、
この訳では独立な節に分離する。
この節が、
この仕様が定義する~modelの主要な部分を成すので。
】</p>
<p>
`~XML直列化$は、
以下に挙げる仕方において,~HTML直列化から相違する:
◎
An XML serialization differs from an HTML serialization in the following ways:
</p>
<ul>
<li>
<p>
[
`要素$/`属性$
]を直列化するときは、
その[
`~ns$eL/`~ns$A
]は,常に保全される。
このことは、
一部の事例では,既存の[
~ns接頭辞/`~ns接頭辞~宣言$/`既定の~ns宣言$
]が[
落とされる/代用される/変更される
](順不同)かもしれないことを意味する。
~HTML直列化は、
~nsを保全するよう試みない。
◎
Elements and attributes will always be serialized such that their namespace is preserved. In some cases this means that an existing prefix, prefix declaration attribute or default namespace declaration attribute might be dropped, substituted or changed. An HTML serialization does not attempt to preserve the namespace.
</p>
<p class="trans-note">【
`~ns接頭辞~宣言@
( `namespace prefix declaration^en )
とは,
`既定の~ns@~XNLNS10#dt-defaultNS$を宣言する`属性$の略記であり、
`既定の~ns宣言@
( `default namespace declaration^en )
とは,`~ns接頭辞@~XNLNS10#dt-prefix$を宣言する`属性$の略記である
(いずれも,`~XMLNS~ns$に属する)。
`XMLNS$r
】【
~ns接頭辞~宣言は、
原文では~ns接頭辞~定義
( `namespace prefix definition^en / `prefix definition^en )