summaryrefslogtreecommitdiff
path: root/xsd-tests/cxx/tree/built-in/testscript
blob: 4dae039d7b7e1d47a90d8f4aad9900ed5b3ec43b (plain)
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
# file      : cxx/tree/any-type/testscript
# license   : GNU GPL v2 + exceptions; see accompanying LICENSE file

: types
:
{
  cat <<EOI >=elements.xml;
    <?xml version="1.0" encoding="UTF-8"?>
    <test:elements
      xmlns:test="http://www.codesynthesis.com/xmlns/test"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.codesynthesis.com/xmlns/test types.xsd">

      <!-- integers -->
      <byte>65</byte>
      <unsigned_byte>66</unsigned_byte>
      <short>-222</short>
      <unsigned_short>57005</unsigned_short>
      <int>-57005</int>
      <unsigned_int>3735928559</unsigned_int>
      <long>-3735928559</long>
      <unsigned_long>16045690984833335023</unsigned_long>
      <integer>-3735928559</integer>
      <non_positive_integer>-3735928559</non_positive_integer>
      <non_negative_integer>3735928559</non_negative_integer>
      <positive_integer>3735928559</positive_integer>
      <negative_integer>-3735928559</negative_integer>


      <!-- boolean -->
      <boolean>true</boolean>


      <!-- floats -->
      <float>1234.1234</float>
      <double>12345678.12345678</double>
      <decimal>12345678.12345678</decimal>


      <!-- strings -->
      <string>string</string>
      <normalized_string>normalized
    string</normalized_string>
      <token>
               one
               two three </token>
      <name>name</name>
      <name_token>name-token</name_token>
      <name_tokens>name tokens</name_tokens>
      <ncname>ncname</ncname>
      <language>en-us</language>

      <!-- qualified name -->
      <qname>xsi:schemaLocation</qname>


      <!-- ID/IDREF -->
      <id>elements1</id>
      <id>elements2</id>
      <id_ref>elements1</id_ref>
      <id_refs>elements1 elements2</id_refs>


      <!-- URI -->
      <any_uri>http://www.codesynthesis.com</any_uri>


      <!-- binary -->
      <base64_binary>YmFzZTY0IGJpbmFyeQ==</base64_binary>
      <hex_binary>6865782052696E617279</hex_binary>


      <!-- date/time -->
      <date>2001-10-26+02:00</date>
      <date_time>2001-10-26T21:32:52+02:00</date_time>
      <duration>P1Y2M3DT5H20M30S</duration>
      <day>---01+02:00</day>
      <month>--11+02:00</month>
      <month_day>--11-02+02:00</month_day>
      <year>2001+02:00</year>
      <year_month>2001-11+02:00</year_month>
      <time>21:32:52+02:00</time>


      <!-- entity -->
      <!--
      <entity>foo</entity>
      <entities>foo bar</entities>
      -->

    </test:elements>
    EOI

  cat <<EOI >=attributes.xml;
    <?xml version="1.0" encoding="UTF-8"?>
    <test:attributes
      xmlns:test="http://www.codesynthesis.com/xmlns/test"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.codesynthesis.com/xmlns/test types.xsd"


      byte="65"
      unsigned_byte="66"
      short="-222"
      unsigned_short="57005"
      int="-57005"
      unsigned_int="3735928559"
      long="-3735928559"
      unsigned_long="16045690984833335023"
      integer="-3735928559"
      non_positive_integer="-3735928559"
      non_negative_integer="3735928559"
      positive_integer="3735928559"
      negative_integer="-3735928559"



      boolean="false"



      float="1234.1234"
      double="12345678.12345678"
      decimal="12345678.12345678"



      string="string"
      normalized_string="normalized string"
      token="  one   two three  "
      name="name"
      name_token="name-token"
      name_tokens="name tokens"
      ncname="ncname"
      language="en-us"


      qname="xsi:schemaLocation"



      id="attributes"
      id_ref="attributes"
      id_refs="attributes"



      any_uri="http://www.codesynthesis.com"



      base64_binary="YmFzZTY0IGJpbmFyeQ=="
      hex_binary="6865782052696E617279"



      date="2001-10-26+02:00"
      date_time="2001-10-26T21:32:52+02:00"
      duration="P1Y2M3DT5H20M30S"
      day="---01+02:00"
      month="--11+02:00"
      month_day="--11-02+02:00"
      year="2001+02:00"
      year_month="2001-11+02:00"
      time="21:32:52+02:00"

    />
    EOI

  cat <<EOI >=inherited.xml;
    <?xml version="1.0" encoding="UTF-8"?>
    <test:inherited
      xmlns:test="http://www.codesynthesis.com/xmlns/test"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.codesynthesis.com/xmlns/test types.xsd">

      <!-- integers -->
      <byte>65</byte>
      <unsigned_byte>66</unsigned_byte>
      <short>-222</short>
      <unsigned_short>57005</unsigned_short>
      <int>-57005</int>
      <unsigned_int>3735928559</unsigned_int>
      <long>-3735928559</long>
      <unsigned_long>16045690984833335023</unsigned_long>
      <integer>-3735928559</integer>
      <non_positive_integer>-3735928559</non_positive_integer>
      <non_negative_integer>3735928559</non_negative_integer>
      <positive_integer>3735928559</positive_integer>
      <negative_integer>-3735928559</negative_integer>


      <!-- boolean -->
      <boolean>true</boolean>


      <!-- floats -->
      <float>1234.1234</float>
      <double>12345678.12345678</double>
      <decimal>12345678.12345678</decimal>


      <!-- strings -->
      <string>string</string>
        <normalized_string>normalized
    string</normalized_string>
      <token>
               one
               two three </token>
      <name>name</name>
      <name_token>name-token</name_token>
      <name_tokens>name tokens</name_tokens>
      <ncname>ncname</ncname>
      <language>en-us</language>

      <!-- qualified name -->
      <qname>xsi:schemaLocation</qname>


      <!-- ID/IDREF -->
      <id>elements1</id>
      <id>elements2</id>
      <id_ref>elements1</id_ref>
      <id_refs>elements1 elements2</id_refs>


      <!-- URI -->
      <any_uri>http://www.codesynthesis.com</any_uri>


      <!-- binary -->
      <base64_binary>YmFzZTY0IGJpbmFyeQ==</base64_binary>
      <hex_binary>6865782052696E617279</hex_binary>


      <!-- date/time -->
      <date>2001-10-26+02:00</date>
      <date_time>2001-10-26T21:32:52+02:00</date_time>
      <duration>P1Y2M3DT5H20M30S</duration>
      <day>---01+02:00</day>
      <month>--11+02:00</month>
      <month_day>--11-02+02:00</month_day>
      <year>2001+02:00</year>
      <year_month>2001-11+02:00</year_month>
      <time>21:32:52+02:00</time>


      <!-- entity -->
      <!--
      <entity>foo</entity>
      <entities>foo bar</entities>
      -->

    </test:inherited>
    EOI

  ln -s $src_base/types.xsd ./;

  $* elements.xml attributes.xml inherited.xml 2>>EOE
    elements:
    byte: A
    unsigned_byte: B
    short: -222
    unsigned_short: 57005
    int: -57005
    unsigned_int: 3735928559
    long: -3735928559
    unsigned_long: 16045690984833335023
    integer: -3735928559
    non_positive_integer: -3735928559
    non_negative_integer: 3735928559
    positive_integer: 3735928559
    negative_integer: -3735928559
    boolean: 1
    float: 1234.12
    double: 1.23457e+07
    decimal: 1.23457e+07
    string: string
    normalized_string: normalized string
    token: one two three
    name: name
    name_token: name-token
    name_tokens: name tokens
    ncname: ncname
    language: en-us
    qname: http://www.w3.org/2001/XMLSchema-instance#schemaLocation
    id: elements1
    id: elements2
    id_ref: elements1
    id_refs: elements1 elements2
    any_uri: http://www.codesynthesis.com
    base64_binary: YmFzZTY0IGJpbmFyeQ==

    hex_binary: 6865782052696E617279
    date: 2001-10-26+02:00
    date_time: 2001-10-26T21:32:52.000000+02:00
    duration: P1Y2M3DT5H20M30.000000S
    day: 01+02:00
    month: 11+02:00
    month_day: 11-02+02:00
    year: 2001+02:00
    year_month: 2001-11+02:00
    time: 21:32:52.000000+02:00

    attributes:
    byte: A
    unsigned_byte: B
    short: -222
    unsigned_short: 57005
    int: -57005
    unsigned_int: 3735928559
    long: -3735928559
    unsigned_long: 16045690984833335023
    integer: -3735928559
    non_positive_integer: -3735928559
    non_negative_integer: 3735928559
    positive_integer: 3735928559
    negative_integer: -3735928559
    boolean: 0
    float: 1234.12
    double: 1.23457e+07
    decimal: 1.23457e+07
    string: string
    normalized_string: normalized string
    token: one two three
    name: name
    name_token: name-token
    name_tokens: name tokens
    ncname: ncname
    language: en-us
    qname: http://www.w3.org/2001/XMLSchema-instance#schemaLocation
    id: attributes
    id_ref: attributes
    id_refs: attributes
    any_uri: http://www.codesynthesis.com
    base64_binary: YmFzZTY0IGJpbmFyeQ==

    hex_binary: 6865782052696E617279
    date: 2001-10-26+02:00
    date_time: 2001-10-26T21:32:52.000000+02:00
    duration: P1Y2M3DT5H20M30.000000S
    day: 01+02:00
    month: 11+02:00
    month_day: 11-02+02:00
    year: 2001+02:00
    year_month: 2001-11+02:00
    time: 21:32:52.000000+02:00

    inherited:
    byte: A
    unsigned_byte: B
    short: -222
    unsigned_short: 57005
    int: -57005
    unsigned_int: 3735928559
    long: -3735928559
    unsigned_long: 16045690984833335023
    integer: -3735928559
    non_positive_integer: -3735928559
    non_negative_integer: 3735928559
    positive_integer: 3735928559
    negative_integer: -3735928559
    boolean: 1
    float: 1234.12
    double: 1.23457e+07
    decimal: 1.23457e+07
    string: string
    normalized_string: normalized string
    token: one two three
    name: name
    name_token: name-token
    name_tokens: name tokens
    ncname: ncname
    language: en-us
    qname: http://www.w3.org/2001/XMLSchema-instance#schemaLocation
    id: elements1
    id: elements2
    id_ref: elements1
    id_refs: elements1 elements2
    any_uri: http://www.codesynthesis.com
    base64_binary: YmFzZTY0IGJpbmFyeQ==

    hex_binary: 6865782052696E617279
    date: 2001-10-26+02:00
    date_time: 2001-10-26T21:32:52.000000+02:00
    duration: P1Y2M3DT5H20M30.000000S
    day: 01+02:00
    month: 11+02:00
    month_day: 11-02+02:00
    year: 2001+02:00
    year_month: 2001-11+02:00
    time: 21:32:52.000000+02:00
    EOE
}