-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathresourceBundle.dtd
137 lines (117 loc) · 4.99 KB
/
resourceBundle.dtd
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
<!-- DTD for ICU resource bundles -->
<!--
Deprecated format!
ICU4C (and to some extent ICU4J) uses its own binary and .txt formats for resource bundles.
Some time ago we defined this XML format that exactly mirrors the binary/.txt formats.
We are retracting this format because
- We are not aware of anyone using it.
- It does not provide any significant advantages over the .txt format.
- It is only now (ICU 2.4) barely supported by ICU tools.
- For application localization we now recommend to use XLIFF,
for which we plan to develop some tools this year
(at least an XLIFF->.txt transformer).
For details about the last two points please see
http://icu.sourceforge.net/userguide/localizing.html
See Jitterbug 2702 and the proposal to the icu mailing list on 2003-jan-07.
-->
<!-- some element and attribute names are truncated to save space -->
<!-- a resource bundle has a name (locale ID if it is a locale resource bundle)
and contains one table (see below) -->
<!ELEMENT resourceBundle (table)>
<!-- the name must only contain "invariant" characters
(subset of ASCII graphic characters) -->
<!ATTLIST resourceBundle name CDATA #REQUIRED>
<!-- a macro for "any one of the possible resource elements" -->
<!ENTITY % anyElement "(str|int|intVector|bin|importBin|array|table|alias)">
<!-- all resource elements have an optional key attribute;
it must be present in elements that are directly nested in a <table>
but must not be present in elements that are directly nested in an <array>;
the key attribute must only contain "invariant" characters
(subset of ASCII graphic characters) and must not be empty -->
<!-- also note that if an empty value is desired in an NMTOKENS attribute,
then the entire attribute must be omitted because NMTOKENS requires
at least one NMTOKEN if there is an attribute -->
<!-- a table, i.e., an array of zero or more (key, value) pairs
where the values are arbitrary resource elements;
all direct sub-elements must have key attributes -->
<!ELEMENT table (%anyElement;)*>
<!ATTLIST table key CDATA #IMPLIED>
<!-- a simple array of zero or more arbitrary resource elements;
all direct sub-elements must not have key attributes -->
<!ELEMENT array (%anyElement;)*>
<!ATTLIST array key CDATA #IMPLIED>
<!-- string,
may contain any Unicode characters and may be empty;
note CDATA parsing rules in XML:
all sequences of whitespace get replaced by single spaces U+0020;
if multiple spaces or CR or LF are intended, then
they must be written as NCRs   
 
 etc. -->
<!ELEMENT str EMPTY>
<!ATTLIST str key CDATA #IMPLIED
val CDATA #IMPLIED>
<!-- Alias,
may contain any Unicode characters and may be empty;
note CDATA parsing rules in XML:
all sequences of whitespace get replaced by single spaces U+0020;
if multiple spaces or CR or LF are intended, then
they must be written as NCRs   
 
 etc. -->
<!ELEMENT alias EMPTY>
<!ATTLIST alias key CDATA #IMPLIED
val CDATA #IMPLIED>
<!-- 28-bit integer (not 32 bits!),
value range: -2^27..2^28-1 to reach all signed and unsigned 32-bit values;
for details see icuhtml/design/bnf_rb.txt;
value format: decimal number or C-style hexadecimal with a 0x prefix -->
<!ELEMENT int EMPTY>
<!ATTLIST int key CDATA #IMPLIED
val NMTOKEN #REQUIRED>
<!-- a vector of zero or more 32-bit integers; for details see icuhtml/design/bnf_rb.txt -->
<!ELEMENT intVector EMPTY>
<!ATTLIST intVector key CDATA #IMPLIED
val NMTOKENS #IMPLIED>
<!-- simple binary data, the val attribute must contain pairs of hex digits -->
<!ELEMENT bin EMPTY>
<!ATTLIST bin key CDATA #IMPLIED
val NMTOKENS #IMPLIED>
<!-- binary data imported from a local file -->
<!ELEMENT importBin EMPTY>
<!ATTLIST importBin key CDATA #IMPLIED
filename CDATA #REQUIRED>
<!-- This is an example of an XML file that is valid with this DTD
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE resourceBundle
SYSTEM "http://oss.software.ibm.com/icu/dtd/resourceBundle.dtd">
<resourceBundle name="eo">
<table>
<int key="a" val="2"/>
<str key="s" val="Vladimir"/>
<str key="s2" val="Markus"/>
<int key="i" val="0x22"/>
<str key="emptyString" val=""/>
<str key="anotherEmptyString"/>
<intVector key="iv" val="20 21 -1 0x7f"/>
<intVector key="emptyIntegerVector"/>
<array key="array">
<int val="20"/>
<str val="Andy"/>
<str val="Andy2"/>
<bin val="fe ff 0a b5"/>
<intVector val="20 21 -1 0x7f"/>
<importBin filename="/other.jpeg"/>
<str/><str val=""/>
<bin/>
<intVector/>
<array/>
<table/>
</array>
<array key="emptyArray"/>
<bin key="b" val="fe ff 0a b5"/>
<bin key="emptyBinary"/>
<importBin key="bb" filename="/something.jpeg"/>
<table key="t">
<int key="t0" val="-21"/>
</table>
<table key="emptyTable"/>
</table>
</resourceBundle>
-->