-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathHTML-common-microsyntaxes-ja.html
5422 lines (5083 loc) · 142 KB
/
HTML-common-microsyntaxes-ja.html
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>HTML Standard — Common microsyntaxes(日本語訳)</title>
<link rel="stylesheet" href="common.css" type="text/css" />
<link rel="stylesheet" href="common-whatwg.css" type="text/css" />
<script src="common0.js" ></script>
<script src="common1.js" async></script>
<script>
Util.ready = function(){
const source_data = {
toc_main: 'common-microsyntaxes',
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) {
switch(match[0]) {
case '❝':
return (
`<span class="code-point">U+00${match[1].charCodeAt(0).toString(16).toUpperCase()}</span> (<span class="char-symbol">${match[1]}</span>)`
);
default://%
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 = `HTML-references.html#refs${key}`;
break;
case 't':
text = `<${key}>`;
break;
case 'l':
text = `"<code class="literal">${text}</code>"`;
break;
case 'U':
text = `U+${key}`;
break;
case 'en':
return `<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:2024-10-21
trans_update:2024-10-22
source_checked:241021
page_state_key:HTML
spec_status:LS
original_url:https://html.spec.whatwg.org/multipage/common-microsyntaxes.html
abbr_url:HTMLcms
nav_prev:HTMLINFRA
nav_next:HTMLurl
trans_1st_pub:2016-01-28
●●class_map
e:element
a:attr
st:attr-state
jA:abstract
t:type
U:code-point
v:value
●●tag_map
I:code
m:code
c:code
e:code
a:code
st:i
v:code
p:code
jA:span
V:var
t:var
mark:mark
i:i
U:span
cite:cite
sub:sub
●●original_id_map
●●link_map
e.input:~HEinput#the-input-element
e.time:~HEtextlevel#the-time-element
e.progress:~HEforms#the-progress-element
e.frameset:~HTMLobs#frameset
a.id:~HTMLdom#the-id-attribute
a.checked:~HEinput#attr-input-checked
a.disabled:~HTMLforms#attr-fe-disabled
a.max:~HEforms#attr-progress-max
a.usemap:~HEimages#attr-hyperlink-usemap
a.datetime:~HEedits#attr-mod-datetime
st.Number:~HEinput#number-state-(type=number)
●
列挙d属性:#enumerated-attribute
真偽-属性:#boolean-attribute
妥当でない値~用の既定の状態:#invalid-value-default
欠落~値~用の既定の状態:#missing-value-default
正準的な~keyword:#canonical-keyword
要素~型:~HTMLINFRA#element-type
一意かつ内部的な値:#unique-internal-value
新たな一意かつ内部的な値:#new-unique-internal-value
●構文
Base10:#_base-ten-integer
Frac10:#_base-ten-fractional
妥当な整数:#valid-integer
妥当な負でない整数:#valid-non-negative-integer
妥当な浮動小数点数:#valid-floating-point-number
妥当な浮動小数点数~list:#valid-list-of-floating-point-numbers
浮動小数点数として最良な表現:#best-representation-of-the-number-as-a-floating-point-number
整数として構文解析する:#rules-for-parsing-integers
負でない整数として構文解析する:#rules-for-parsing-non-negative-integers
浮動小数点数として構文解析する:#rules-for-parsing-floating-point-number-values
浮動小数点数~listとして構文解析する:#rules-for-parsing-a-list-of-floating-point-numbers
~commaで分離された~token集合:#set-of-comma-separated-tokens
~space等で分離された~token集合:#set-of-space-separated-tokens
●date&time
日時:#concept-datetime
大域的~日時:#concept-datetime
局所的~日時:#concept-datetime-local
偏差:#concept-timezone
時間帯:#time-zones
日付:#concept-date
時刻:#concept-time
年月t:#concept-month
月日t:#concept-yearless-date
年週t:#concept-week
月tの日t数:#number-of-days-in-month-month-of-year-year
週t数:#week-number-of-the-last-day
最後の日tの週t番号:#week-number-of-the-last-day
時間長:#concept-duration
時間長~成分:#duration-time-component
時間長~成分の縮尺:#duration-time-component-scale
遡及~Gregorian日付:#proleptic-gregorian-date
遡及~Gregorian暦:#proleptic-gregorian-calendar
妥当な偏差~文字列:#valid-time-zone-offset-string
妥当な大域的~日時~文字列:#valid-global-date-and-time-string
妥当な局所的~日時~文字列:#valid-local-date-and-time-string
妥当な月日t文字列:#valid-yearless-date-string
妥当な日付~文字列:#valid-date-string
妥当な省略あり日時~文字列:#valid-date-string-with-optional-time
妥当な時刻~文字列:#valid-time-string
妥当な時間長~文字列:#valid-duration-string
妥当な年月t文字列:#valid-month-string
妥当な正規化-済み局所的~日時~文字列:#valid-normalised-local-date-and-time-string
妥当な年週t文字列:#valid-week-string
大域的~日時~文字列を構文解析する:#parse-a-global-date-and-time-string
局所的~日時~文字列を構文解析する:#parse-a-local-date-and-time-string
偏差~文字列を構文解析する:#parse-a-time-zone-offset-string
偏差~成分を構文解析する:#parse-a-time-zone-offset-component
月日t文字列を構文解析する:#parse-a-yearless-date-string
月日t成分を構文解析する:#parse-a-yearless-date-component
省略あり日時~文字列を構文解析する:#parse-a-date-or-time-string
日付~文字列を構文解析する:#parse-a-date-string
日付~成分を構文解析する:#parse-a-date-component
時刻~文字列を構文解析する:#parse-a-time-string
時刻~成分を構文解析する:#parse-a-time-component
時間長~文字列を構文解析する:#parse-a-duration-string
年月t文字列を構文解析する:#parse-a-month-string
年月t成分を構文解析する:#parse-a-month-component
年週t文字列を構文解析する:#parse-a-week-string
●CSS
寸法~listとして構文解析する:#rules-for-parsing-a-list-of-dimensions
寸法~値として構文解析する:#rules-for-parsing-dimension-values
非~zero寸法~値として構文解析する:#rules-for-parsing-non-zero-dimension-values
旧来の色~値として構文解析する:#rules-for-parsing-a-legacy-colour-value
~hash名~参照として構文解析する:#rules-for-parsing-a-hash-name-reference
妥当な~hash名~参照:#valid-hash-name-reference
利用者の環境に合致して:#matches-the-environment
妥当な媒体~query~list:#valid-media-query-list
t.media-query-list:~MQ5#typedef-media-query-list
反映する:~HTMLcdom#reflect
●外部
~list:~INFRA#list
~size:~INFRA#list-size
付加する:~INFRA#list-append
位置~変数:~INFRA#string-position-variable
符号位置:~INFRA#code-point
cp.値:~INFRA#code-point-value
符号位置~長さ:~INFRA#string-code-point-length
符号位置~長さ:characters long
符号位置~部分文字列:~INFRA#code-point-substring
終端までを成す符号位置~部分文字列:~INFRA#code-point-substring-to-the-end-of-the-string
一致-:~INFRA#string-is
~ASCII大小無視:~INFRA#ascii-case-insensitive
sub.大小無視:~INFRA#ascii-case-insensitive
~ASCII空白:~INFRA#ascii-whitespace
~ASCII数字:~INFRA#ascii-digit
~ASCII~hex数字:~INFRA#ascii-hex-digit
~ASCII空白を読飛ばす:~INFRA#skip-ascii-whitespace
前後の~ASCII空白~列を剥ぐ:~INFRA#strip-leading-and-trailing-ascii-whitespace
符号位置~並びを収集する:~INFRA#collect-a-sequence-of-code-points
~tree:~DOM4#concept-tree
~tree順序:~DOM4#concept-tree-order
jA.ToString:~TC39#sec-tostring
有名~色:~CSSCOLOR#named-color
●●words_table1
FORMSintro:HTML-forms-intro-ja.html
●●words_table
●仕様
協調-:coordinate:~
読み易い:readable
受渡し:round-tripping:受け渡し
誤解釈:misinterpreting:~
注記
織り込
織り込:takes into account
当時の:contemporary
傾向:tend:~
文化的:cultural:~
政治的裁定:policy decisions:~
政治的駆引き:political footballs:政治的駆け引き
永劫:forever:~
注目:notable:~
偏向:bias:~
する限りにおいて:insofar
きちんと:well
気まぐれな:very whimsical
出来事:event
~~実用されている:real
大きく変わる:greatly vary
成句的な:idiom
その逆も同様:vice versa
●構文
SPACE:
zero::::ゼロ
hash::::ハッシュ
hash-name
hex::16 進
16 進:hexadecimal
値なし:missing value:~
正規化-済み:normalized
読飛ばす:skipする:読み飛ばす
剥ぐ:stripする:~
基本多言語面:basic multilingual plane::~
符号:sign:~
有符号:signed:~
実数:number:~
倍精度:double-precision:~
浮動小数点数:floating-point number:~
仮数:significand:~
小数:fraction:~
小数~部:fractional part
指数:exponent:~
小構文:microsyntax::~
一義化子:-disambiguator:~
部分文字列:substring::~
-:subcomponent
尾部:trailing
頭部:leading
順に
Advance position to the next character
hash-name
micro-parser:
space::::
失敗:fail
無用な文字~並び:garbage
偶数:even
●暦
Gregorian::::グレゴリオ
Julian::::ユリウス
London::::ロンドン
^en:Greenwich
ISO8601:ISO 8601
Roman-Emperor:Roman Emperor::ローマ皇帝
Nero::::ネロ
UT1::::
UTC::::
February
October
SI
USA
遡及:proleptic::~
閏:leap::~
年t:year::年
月t:month::月
年月t:year&month::年&月
月日t:month&date::月&日
日t:day::日
週t:week::週
年週t:year&week::年&週
時t:hour::時
分t:minute::分
秒t:second::秒
週年t:week-year::週年
年なし:yearless::~
日時:date&time::~
時間帯:time zone::~
時刻:moments in time
偏差:time-zone offset::~
milli::::ミリ
~milli秒t:millisecond
夏時間:daylight saving time::~
太陽時:Earth solar time::~
時間長:duration::~
時間長~成分:duration time component:
~~時間:hour
暦:calendar::~
暦付け:calendaring::~
最大日数:maxday::~
-:maxweek
番号:number:~
水曜:Wednesday::~
火曜:Thursday::~
月曜:Monday::~
七日間:seven-day period:~
地域:area:~
地域化-:localize::~::ローカル化
生誕:birth:~
誕生日:birthday:~
真昼:noon:~
期間:period:~
東海岸:east-coast:~
真夜中:midnight:~
経度:longitude:~
縮尺:scale:~
外部補間-:extrapolate:~
前近代:ancient times:~
比較的近代:relatively recent decades:~
世紀:century:~
中頃:mid:~
制定:formation:~
1 月:January
12 月:December
timezone
timezonehour
timezoneminute
~~曖昧な:vaguer moments
●CSS
red:
green:
blue:
RGB:
●未分類
刻む:tickする:~
無毒化:sanitization::~
減算-:subtract:~
近似-:approximate:~
近似:approximation:~
重複-:duplicate:~
混在させ:mixし:~
check::::チェック
checkbox::::チェックボックス
zero::::ゼロ
literal
伝送路:wire:~
当地域:place:~
整数 ~IN :8-bit numbers in
-:increment
現れる
加えて
加える
有-
残りの
示す:show
表す
記され
課され
選ぶ
呼ばれ
指して
指す:refer/point
書いて
書き
満た
対応付けら
遡って:backward
用い
表記
表記規約
指している:pointer into
-:arbitrary
数
伴う
入って
単に
場合
何
内
列
対し
後の
応じて
成す
所で
方
方法
有無
生
最も小さい:smallest
最短な:shortest
〜の倍数:divisible
超える
近い
進んでいる:ahead of
INCBY:advance position
:care
:count
:followed by
:forcibly
:moment
~zero詰めされ:zero-padded
:part
:past
:refer
:sum
:four
ずっと:much more
掛けた:scaleした
一方
一部
下
両方
中の
乗
互いに
他
以上
以下
以前の:previous/predate
それまで:previously
以外
先頭
別
前後
前述
次
片方
様々な:various
自体も
複数の
該当-
限ら
限り
非
●●trans_metadata
<p>
~THIS_PAGEは、~WHATWGによる HTML 仕様の
<a href="~SPEC_URL">§ Common microsyntaxes</a>
を日本語に翻訳したものです。
~PUB
</p>
</script>
</head>
<body>
<header>
<hgroup>
<h1>HTML — 共通な小構文</h1>
</hgroup>
</header>
<main id="MAIN" hidden>
<section id="common-microsyntaxes">
<h3 title="Common microsyntaxes">2.3. 共通な小構文</h3>
<p>
~HTMLでは,様々な所で,日付や実数などを表現する特定0の~data型を受容する。
この節では、
それらの形式による内容に対する適合性の判定基準, および
それらを構文解析する方法について述べる。
◎
There are various places in HTML that accept particular data types, such as dates or numbers. This section describes what the conformance criteria for content in those formats is, and how to parse them.
</p>
<p class="note">注記:
実装者には、以下に述べる構文の構文解析を実装するにあたり,第三者-主体による~libraryの利用を考慮するときは、
注意深く精査することが強く督促される。
例えば、
日付~libraryにおける~errorの取扱いは、
この仕様にて要求されるものから相違する挙動を実装している~~可能性が高い。
~error取扱いの挙動は、
この仕様にて利用される構文に類似な日付~構文を述べる仕様では,定義されていないことが多いため、
実装によって大きく異なる傾向にある。
◎
Implementers are strongly urged to carefully examine any third-party libraries they might consider using to implement the parsing of syntaxes described below. For example, date libraries are likely to implement error handling behavior that differs from what is required in this specification, since error-handling behavior is often not defined in specifications that describe date syntaxes similar to those used in this specification, and thus implementations tend to vary greatly in how they handle errors.
</p>
<section id="_conventions">
<h4>【この訳に特有な表記規約】</h4>
◎表記記号
</section>
<section id="common-parser-idioms">
<h4 title="Common parser idioms">2.3.1. 共通な成句的な構文解析器</h4>
<p>
以下に述べる一部の構文解析器は、
構文解析される文字列を保持する変数 %入力,
および 次に構文解析される文字を指す変数 %位置 を用いる~patternに従う。
【詳細は、以下に現れる %位置↗ という表記も含め,`位置~変数$を参照されたし。】
◎
Some of the micro-parsers described below follow the pattern of having an input variable that holds the string being parsed, and having a position variable pointing at the next character to parse in input.
</p>
</section>
<section id="boolean-attributes">
<h4 title="Boolean attributes">2.3.2. 真偽-属性</h4>
<p>
いくつかの内容~属性は、
`真偽-属性@
であるとされる。
要素に真偽-属性が[
在ることは ~T 値 /
無いことは ~F 値
]を表現する。
◎
A number of attributes are boolean attributes. The presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value.
</p>
<p>
真偽-属性は、
在るならば,[
その値 ~IN`大小無視$sub { 空~文字列, 属性の正準的な名前 }
]でなければナラナイ( 属性~値の頭部にも尾部にも空白は許容されない)。
◎
If the attribute is present, its value must either be the empty string or a value that is an ASCII case-insensitive match for the attribute's canonical name, with no leading or trailing whitespace.
</p>
<p class="note">注記:
真偽-属性に対しては,値[
`true^l / `false^l
]は許容されない。
~F 値を表現するためには、
属性~自体も省略する必要がある。
◎
The values "true" and "false" are not allowed on boolean attributes. To represent a false value, the attribute has to be omitted altogether.
</p>
<div class="example">
<p>
~checkされ, かつ不能化された( `checked^en & `disabled^en )~checkboxの例をここに示す。
[
`checked$a, `disabled$a
]属性は、
どちらも真偽-属性である。
◎
Here is an example of a checkbox that is checked and disabled. The checked and disabled attributes are the boolean attributes.
</p>
<pre class="lang-html">
<label><input
type=checkbox
`checked^mark
name=cheese
`disabled^mark
> Cheese</label>
</pre>
<p>
これは、
次のように書いても等価になる:
◎
This could be equivalently written as this:
</p>
<pre class="lang-html">
<label><input
type=checkbox
`checked=checked^mark
name=cheese
`disabled=disabled^mark
> Cheese</label>
</pre>
<p>
次のように書き方を混在させても依然として等価になる:
◎
You can also mix styles; the following is still equivalent:
</p>
<pre class="lang-html">
<label><input
type='checkbox'
`checked^mark
name=cheese
`disabled=""^mark
> Cheese</label>
</pre>
</div>
</section>
<section id="keywords-and-enumerated-attributes">
<h4 title="Keywords and enumerated attributes">2.3.3. ~keyword, 列挙d属性</h4>
<div class="p">
<p>
一部の内容~属性は、
`列挙d属性@
とされ,次が指定される:
</p>
<ul>
<li>
ある有限~個の状態たちが成す集合 %S
</li>
<li>
~keywordたちが成す集合 %K
</li>
<li>
%K から %S への対応付け
</li>
<li>
`妥当でない値~用の既定の状態@
⇒
ε /
ある状態 ~IN %S
</li>
<li>
`欠落~値~用の既定の状態@
⇒
ε /
ある状態 ~IN %S
</li>
</ul>
<p>
要素~上の`列挙d属性$の状態は、
%S 内の いずれかの状態になるか, ε ( 状態は “無い” )になる。
状態は、
属性の値と上に挙げたものを組合せることにより導出される。
</p>
<p class="trans-note">【
他所を簡潔に述べるため、
この訳では, ε を導入して定義を少し改めている。
各種 既定の状態の定義における ε は、
“状態は指定されない”
ことを表す。
】</p>
◎
Some attributes, called enumerated attributes, take on a finite set of states. The state for such an attribute is derived by combining the attribute's value, a set of keyword/state mappings given in the specification of each attribute, and two possible special states that can also be given in the specification of the attribute. These special states are the invalid value default and the missing value default.
</div>
<p class="note">注記:
複数の~keywordが同じ状態に対応付けられることもある。
◎
Multiple keywords can map to the same state.
</p>
<p class="trans-note">【
各種 既定の状態には、
それに対応付けられる~keywordが無いものもある。
】</p>
<p class="note">注記:
空~文字列が妥当な~keywordになることもある。
`欠落~値~用の既定の状態$が適用されるのは、
当の属性が`欠落な^emときに限られ,
値に空~文字列を伴う属性が在るときではないことに注意。
◎
The empty string can be a valid keyword. Note that the missing value default applies only when the attribute is missing, not when it is present with an empty string value.
</p>
<div class="algo">
<p>
%要素 上の`列挙d属性$ %属性 の状態を決定するときは、
次の手続きを利用する:
◎
To determine the state of an attribute, use the following steps:
</p>
<ol>
<li>
~IF[
%要素 は %属性 を有さない
]
⇒
~RET %属性 の`欠落~値~用の既定の状態$
◎
If the attribute is not specified:
• If the attribute has a missing value default state defined, then return that missing value default state.
• Otherwise, return no state.
</li>
<li>
~IF[
%属性 用の~keywordに[
%属性 の値 ~EQ`大小無視$sub ~keyword
]を満たすものがある
]
⇒
~RET その~keywordに対応する状態
◎
If the attribute's value is an ASCII case-insensitive match for one of the keywords defined for the attribute, then return the state represented by that keyword.
</li>
<li>
~RET %属性 の`妥当でない値~用の既定の状態$
◎
If the attribute has an invalid value default state defined, then return that invalid value default state.
◎
Return no state.
</li>
</ol>
</div>
<p>
著作~適合性の目的においては、
要素に ある列挙d属性を指定する場合,
その値は[
当の属性~用の適合な~keywordのうち,いずれか
]に`~ASCII大小無視$で合致しなければナラナイ
— 頭部にも尾部にも空白を伴うことなく。
【そのような空白を伴う~keywordが定義されることは、決してない。】
◎
For authoring conformance purposes, if an enumerated attribute is specified, the attribute's value must be an ASCII case-insensitive match for one of the conforming keywords for that attribute, with no leading or trailing whitespace.
</p>
<div class="algo">
<p>
`反映する$目的においては、
各 状態には,
`正準的な~keyword@
が定義される
— それは、
当の状態に対応付けられる~keywordたちが成す集合を %K とするとき,
次に従って決定される:
◎
For reflection purposes, states which have any keywords mapping to them are said to have a canonical keyword. This is determined as follows:
</p>
<ul class="switch">
<li>
%K は空な場合
⇒
ε ( “存在しない” )†
</li>
<li>
%K は 1 個の~keywordのみからなる場合
⇒
その~keyword
◎
If there is only one keyword mapping to the given state, then it is that keyword.
</li>
<li>
%K 内には`適合^emな~keywordが 1 つだけ在る場合
⇒
その~keyword
◎
If there is only one conforming keyword mapping to the given state, then it is that conforming keyword.
</li>
<li>
他の場合
⇒
%K 内の ある~keywordが、
当の属性により`正準的な~keyword$として指定されることになる
◎
Otherwise, the canonical keyword for the state will be explicitly given in the specification for the attribute.
</li>
</ul>
<p class="trans-note">【†
ここでも,
他所を簡潔に述べるため、
この訳では, ε をとり得るよう定義を改めている。
】</p>
</div>
</section>
<section id="numbers">
<h4 title="Numbers">2.3.4. 実数</h4>
<p>
所与の[
0 個以上の`~ASCII数字$
]たちが成す文字列 %s に対し:
</p>
<ul>
<li class="algo">
<p>
`Base10@
( %s )
は、
次を走らせた結果を返す:
</p>
<ol>
<li>
%結果 ~LET 0
</li>
<li>
%s を成す
~EACH( 文字 %d )
に対し,先頭から順に
⇒
%結果 ~SET ( %結果 ~MUL 10 ) ~PLUS ( %d の`値$cp ~MINUS ❝0 の`値$cp (すなわち, %d を 10 進数として解釈した結果) )
</li>
<li>
~RET %結果
</li>
</ol>
</li>
<li class="algo">
`Frac10@
( %s )
は、
次の結果を返す
⇒
`Base10$( %s ) ~DIV ( 10 の ( %s の`符号位置~長さ$ ) 乗 )
</li>
</ul>
<p class="trans-note">【
これらの~algoは、
以下を簡潔に述べるために,この訳にて導入したものである。
原文には, `Base10$ にあたる~algoは定義されていない
(単に, “10 進数として解釈する” と記されている)
が、
それに依存する `Frac10$ を利用している箇所には~algoが与えられているので,等価になるものをここに定義している。
】</p>
<section id="signed-integers">
<h5 title="Signed integers">2.3.4.1. 有符号~整数</h5>
<div class="p">
<p>
次の並びからなる文字列は
`妥当な整数@
とされる:
</p>
<ol>
<li>
0 〜 1 個の文字 ❝-
</li>
<li>
1 個以上の`~ASCII数字$
</li>
</ol>
◎
A string is a valid integer if it consists of one or more ASCII digits, optionally prefixed with a U+002D HYPHEN-MINUS character (-).
</div>
<p>
`妥当な整数$は
⇒
❝- を[
伴わないならば 1 /
伴うならば −1
] ~MUL `Base10$( その中の数字~列 ) を表現する。
◎
A valid integer without a U+002D HYPHEN-MINUS (-) prefix represents the number that is represented in base ten by that string of digits. A valid integer with a U+002D HYPHEN-MINUS (-) prefix represents the number represented in base ten by the string of digits that follows the U+002D HYPHEN-MINUS, subtracted from zero.
</p>
<div class="algo">
<p>
`整数として構文解析する@
規則は、
所与の
( 文字列 %入力 )
に対し,[
整数 / `失敗^i
]を返す:
【!以下略:When invoked, ...】
◎
The rules for parsing integers are as given in the following algorithm. When invoked, the steps must be followed in the order given, aborting at the first step that returns a value. This algorithm will return either an integer or an error.
</p>
<ol>
<li>
%位置 ~LET %入力 の先頭の文字を指している`位置~変数$
◎
Let input be the string being parsed.
◎
Let position be a pointer into input, initially pointing at the start of the string.
</li>
<li>
%符号 ~LET 1
◎
Let sign have the value "positive".
</li>
<li>