xml-toolkit 1.0.14 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -157,8 +157,17 @@ const XMLMarshaller = class {
157
157
  : name
158
158
 
159
159
  ) + '="'
160
-
161
- this.appendScalar (this.xs.getByReference (type), v)
160
+
161
+ if (type) {
162
+
163
+ this.appendScalar (this.xs.getByReference (type), v)
164
+
165
+ }
166
+ else {
167
+
168
+ for (const child of node.children) if (child.localName === 'simpleType') this.appendScalar (child, v)
169
+
170
+ }
162
171
 
163
172
  this.buf += '"'
164
173
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xml-toolkit",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "Collection of classes for dealing with XML",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,524 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fns="urn://x-artefacts-fns-dohflna/types/4.0.1" targetNamespace="urn://x-artefacts-fns-dohflna/types/4.0.1" elementFormDefault="qualified" attributeFormDefault="unqualified">
3
+ <!--========================================== Структурированные типы ==========================================-->
4
+ <xs:complexType name="IdentityDocumentType">
5
+ <xs:annotation>
6
+ <xs:documentation>Сведения о документе, удостоверяющем личность физического лица</xs:documentation>
7
+ </xs:annotation>
8
+ <xs:attribute name="DocumentCode" type="fns:SPDULType" use="required">
9
+ <xs:annotation>
10
+ <xs:documentation>Код вида документа, удостоверяющего личность</xs:documentation>
11
+ </xs:annotation>
12
+ </xs:attribute>
13
+ <xs:attribute name="SeriesNumber" type="fns:SPDULTemplateType" use="required">
14
+ <xs:annotation>
15
+ <xs:documentation>Серия и номер документа, удостоверяющего личность</xs:documentation>
16
+ </xs:annotation>
17
+ </xs:attribute>
18
+ <xs:attribute name="IssuerDate" type="xs:date" use="optional">
19
+ <xs:annotation>
20
+ <xs:documentation>Дата выдачи документа, удостоверяющего личность</xs:documentation>
21
+ </xs:annotation>
22
+ </xs:attribute>
23
+ <xs:attribute name="Issuer" type="fns:string-255" use="optional">
24
+ <xs:annotation>
25
+ <xs:documentation>Наименование органа, выдавшего документ, удостоверяющий личность</xs:documentation>
26
+ </xs:annotation>
27
+ </xs:attribute>
28
+ <xs:attribute name="IssuerCode" type="fns:string-7" use="optional">
29
+ <xs:annotation>
30
+ <xs:documentation>Код подразделения органа, выдавшего документ, удостоверяющий личность</xs:documentation>
31
+ </xs:annotation>
32
+ </xs:attribute>
33
+ </xs:complexType>
34
+ <xs:complexType name="IdentityDocumentShortType">
35
+ <xs:annotation>
36
+ <xs:documentation>Сведения (краткие) о документе, удостоверяющем личность физического лица</xs:documentation>
37
+ </xs:annotation>
38
+ <xs:attribute name="DocumentCode" type="fns:SPDULType" use="required">
39
+ <xs:annotation>
40
+ <xs:documentation>Код вида документа, удостоверяющего личность</xs:documentation>
41
+ </xs:annotation>
42
+ </xs:attribute>
43
+ <xs:attribute name="SeriesNumber" type="fns:SPDULTemplateType" use="required">
44
+ <xs:annotation>
45
+ <xs:documentation>Серия и номер документа, удостоверяющего личность</xs:documentation>
46
+ </xs:annotation>
47
+ </xs:attribute>
48
+ </xs:complexType>
49
+ <xs:complexType name="PhysicalPersonDataType">
50
+ <xs:sequence>
51
+ <xs:element name="PhysicalPersonName" type="fns:PhysicalPersonNameType">
52
+ <xs:annotation>
53
+ <xs:documentation>Фамилия, имя, отчество физического лица</xs:documentation>
54
+ </xs:annotation>
55
+ </xs:element>
56
+ <xs:element name="IdentityDocument" type="fns:IdentityDocumentType">
57
+ <xs:annotation>
58
+ <xs:documentation>Сведения о документе, удостоверяющем личность физического лица</xs:documentation>
59
+ </xs:annotation>
60
+ </xs:element>
61
+ </xs:sequence>
62
+ <xs:attribute name="BirthDate" type="xs:date" use="required">
63
+ <xs:annotation>
64
+ <xs:documentation>Дата рождения</xs:documentation>
65
+ </xs:annotation>
66
+ </xs:attribute>
67
+ <xs:attribute name="BirthPlace" type="fns:string-255" use="optional">
68
+ <xs:annotation>
69
+ <xs:documentation>Место рождения</xs:documentation>
70
+ </xs:annotation>
71
+ </xs:attribute>
72
+ </xs:complexType>
73
+ <xs:complexType name="PhysicalPersonNameType">
74
+ <xs:annotation>
75
+ <xs:documentation>Фамилия, имя, отчество физического лица</xs:documentation>
76
+ </xs:annotation>
77
+ <xs:attribute name="FamilyName" type="fns:string-60" use="required">
78
+ <xs:annotation>
79
+ <xs:documentation>Фамилия</xs:documentation>
80
+ </xs:annotation>
81
+ </xs:attribute>
82
+ <xs:attribute name="FirstName" type="fns:string-60" use="required">
83
+ <xs:annotation>
84
+ <xs:documentation>Имя</xs:documentation>
85
+ </xs:annotation>
86
+ </xs:attribute>
87
+ <xs:attribute name="Patronymic" type="fns:string-60" use="optional">
88
+ <xs:annotation>
89
+ <xs:documentation>Отчество</xs:documentation>
90
+ </xs:annotation>
91
+ </xs:attribute>
92
+ </xs:complexType>
93
+ <xs:simpleType name="digits-20">
94
+ <xs:annotation>
95
+ <xs:documentation>Строка, состоящая из двадцати цифр</xs:documentation>
96
+ <xs:documentation>Содержит только цифры</xs:documentation>
97
+ </xs:annotation>
98
+ <xs:restriction base="xs:string">
99
+ <xs:length value="20"/>
100
+ <xs:pattern value="\d{20}"/>
101
+ </xs:restriction>
102
+ </xs:simpleType>
103
+ <xs:simpleType name="digits-11">
104
+ <xs:annotation>
105
+ <xs:documentation>Строка, состоящая из одиннадцати цифр. Например номер записи</xs:documentation>
106
+ </xs:annotation>
107
+ <xs:restriction base="xs:string">
108
+ <xs:length value="11"/>
109
+ <xs:pattern value="\d{11}"/>
110
+ </xs:restriction>
111
+ </xs:simpleType>
112
+ <xs:simpleType name="digits-6">
113
+ <xs:annotation>
114
+ <xs:documentation>Строка, состоящая из 6 цифр</xs:documentation>
115
+ <xs:documentation>Содержит только цифры</xs:documentation>
116
+ </xs:annotation>
117
+ <xs:restriction base="xs:string">
118
+ <xs:length value="6"/>
119
+ <xs:pattern value="\d{6}"/>
120
+ </xs:restriction>
121
+ </xs:simpleType>
122
+ <xs:simpleType name="digits-4">
123
+ <xs:annotation>
124
+ <xs:documentation>Строка, состоящая из четырёх цифр</xs:documentation>
125
+ <xs:documentation>Содержит только цифры</xs:documentation>
126
+ </xs:annotation>
127
+ <xs:restriction base="xs:string">
128
+ <xs:length value="4"/>
129
+ <xs:pattern value="\d{4}"/>
130
+ </xs:restriction>
131
+ </xs:simpleType>
132
+ <xs:simpleType name="digits-3">
133
+ <xs:annotation>
134
+ <xs:documentation>Строка, состоящая из 3 цифр</xs:documentation>
135
+ <xs:documentation>Содержит только цифры</xs:documentation>
136
+ </xs:annotation>
137
+ <xs:restriction base="xs:string">
138
+ <xs:length value="3"/>
139
+ <xs:pattern value="\d{3}"/>
140
+ </xs:restriction>
141
+ </xs:simpleType>
142
+ <xs:simpleType name="digits-2">
143
+ <xs:annotation>
144
+ <xs:documentation>Строка, состоящая из 2 цифр</xs:documentation>
145
+ <xs:documentation>Содержит только цифры</xs:documentation>
146
+ </xs:annotation>
147
+ <xs:restriction base="xs:string">
148
+ <xs:length value="2"/>
149
+ <xs:pattern value="\d{2}"/>
150
+ </xs:restriction>
151
+ </xs:simpleType>
152
+ <xs:simpleType name="KPPType">
153
+ <xs:annotation>
154
+ <xs:documentation>Код причины постановки на учет (КПП) </xs:documentation>
155
+ </xs:annotation>
156
+ <xs:restriction base="xs:string">
157
+ <xs:length value="9"/>
158
+ <xs:pattern value="([0-9]{1}[1-9]{1}|[1-9]{1}[0-9]{1})([0-9]{2})([0-9A-F]{2})([0-9]{3})"/>
159
+ </xs:restriction>
160
+ </xs:simpleType>
161
+ <xs:simpleType name="IDRequestType">
162
+ <xs:restriction base="xs:string">
163
+ <xs:minLength value="1"/>
164
+ <xs:maxLength value="36"/>
165
+ </xs:restriction>
166
+ </xs:simpleType>
167
+ <xs:simpleType name="LegalPersonINNType">
168
+ <xs:annotation>
169
+ <xs:documentation>Идентификационный номер налогоплательщика - организации</xs:documentation>
170
+ </xs:annotation>
171
+ <xs:restriction base="xs:string">
172
+ <xs:length value="10"/>
173
+ <xs:pattern value="([0-9]{1}[1-9]{1}|[1-9]{1}[0-9]{1})[0-9]{8}"/>
174
+ </xs:restriction>
175
+ </xs:simpleType>
176
+ <xs:simpleType name="number-17_2">
177
+ <xs:annotation>
178
+ <xs:documentation>Число десятичноеое, содержащее до 17 разрядов, два после запятой</xs:documentation>
179
+ <xs:documentation>Содержит только цифры</xs:documentation>
180
+ </xs:annotation>
181
+ <xs:restriction base="xs:decimal">
182
+ <xs:totalDigits value="17"/>
183
+ <xs:fractionDigits value="2"/>
184
+ </xs:restriction>
185
+ </xs:simpleType>
186
+ <xs:simpleType name="number-14_2">
187
+ <xs:annotation>
188
+ <xs:documentation>Число десятичноеое, содержащее до 14 разрядов, два после запятой</xs:documentation>
189
+ <xs:documentation>Содержит только цифры</xs:documentation>
190
+ </xs:annotation>
191
+ <xs:restriction base="xs:decimal">
192
+ <xs:totalDigits value="14"/>
193
+ <xs:fractionDigits value="2"/>
194
+ </xs:restriction>
195
+ </xs:simpleType>
196
+ <xs:simpleType name="number-15">
197
+ <xs:annotation>
198
+ <xs:documentation>Число целое, содержащее до 15 разрядов</xs:documentation>
199
+ <xs:documentation>Содержит только цифры</xs:documentation>
200
+ </xs:annotation>
201
+ <xs:restriction base="xs:integer">
202
+ <xs:totalDigits value="15"/>
203
+ </xs:restriction>
204
+ </xs:simpleType>
205
+ <xs:simpleType name="number-12">
206
+ <xs:annotation>
207
+ <xs:documentation>Число целое, содержащее до 12 разрядов</xs:documentation>
208
+ <xs:documentation>Содержит только цифры</xs:documentation>
209
+ </xs:annotation>
210
+ <xs:restriction base="xs:integer">
211
+ <xs:totalDigits value="12"/>
212
+ </xs:restriction>
213
+ </xs:simpleType>
214
+ <xs:simpleType name="number-9">
215
+ <xs:annotation>
216
+ <xs:documentation>Число целое, содержащее до 9 разрядов</xs:documentation>
217
+ <xs:documentation>Содержит только цифры</xs:documentation>
218
+ </xs:annotation>
219
+ <xs:restriction base="xs:integer">
220
+ <xs:totalDigits value="9"/>
221
+ </xs:restriction>
222
+ </xs:simpleType>
223
+ <xs:simpleType name="number-4">
224
+ <xs:annotation>
225
+ <xs:documentation>Число целое, содержащее до 4 разрядов</xs:documentation>
226
+ <xs:documentation>Содержит только цифры</xs:documentation>
227
+ </xs:annotation>
228
+ <xs:restriction base="xs:integer">
229
+ <xs:totalDigits value="4"/>
230
+ </xs:restriction>
231
+ </xs:simpleType>
232
+ <xs:simpleType name="number-3">
233
+ <xs:annotation>
234
+ <xs:documentation>Число целое, содержащее до 3 разрядов</xs:documentation>
235
+ <xs:documentation>Содержит только цифры</xs:documentation>
236
+ </xs:annotation>
237
+ <xs:restriction base="xs:integer">
238
+ <xs:totalDigits value="3"/>
239
+ </xs:restriction>
240
+ </xs:simpleType>
241
+ <xs:simpleType name="number-2">
242
+ <xs:annotation>
243
+ <xs:documentation>Число целое, содержащее до 2 разрядов</xs:documentation>
244
+ <xs:documentation>Содержит только цифры</xs:documentation>
245
+ </xs:annotation>
246
+ <xs:restriction base="xs:integer">
247
+ <xs:totalDigits value="2"/>
248
+ </xs:restriction>
249
+ </xs:simpleType>
250
+ <xs:simpleType name="number-1">
251
+ <xs:annotation>
252
+ <xs:documentation>Число целое, содержащее 1 разряд</xs:documentation>
253
+ <xs:documentation>Содержит только цифры</xs:documentation>
254
+ </xs:annotation>
255
+ <xs:restriction base="xs:integer">
256
+ <xs:totalDigits value="1"/>
257
+ </xs:restriction>
258
+ </xs:simpleType>
259
+ <xs:simpleType name="OKTMOType">
260
+ <xs:annotation>
261
+ <xs:documentation>Код Общероссийского классификатора территорий муниципальных образований</xs:documentation>
262
+ <xs:documentation>Содержит только цифры</xs:documentation>
263
+ </xs:annotation>
264
+ <xs:restriction base="xs:string">
265
+ <xs:minLength value="8"/>
266
+ <xs:maxLength value="11"/>
267
+ <xs:pattern value="\d{8}"/>
268
+ <xs:pattern value="\d{11}"/>
269
+ </xs:restriction>
270
+ </xs:simpleType>
271
+ <xs:simpleType name="OKCMType">
272
+ <xs:annotation>
273
+ <xs:documentation>Код Общероссийского классификатора стран мира (3-разрядный, цифровой)</xs:documentation>
274
+ <xs:documentation>Содержит только цифры</xs:documentation>
275
+ </xs:annotation>
276
+ <xs:restriction base="xs:string">
277
+ <xs:length value="3"/>
278
+ <xs:pattern value="\d{3}"/>
279
+ </xs:restriction>
280
+ </xs:simpleType>
281
+ <xs:simpleType name="PhysicalPersonINNType">
282
+ <xs:annotation>
283
+ <xs:documentation>Идентификационный номер налогоплательщика - физического лица</xs:documentation>
284
+ </xs:annotation>
285
+ <xs:restriction base="xs:string">
286
+ <xs:length value="12"/>
287
+ <xs:pattern value="([0-9]{1}[1-9]{1}|[1-9]{1}[0-9]{1})[0-9]{10}"/>
288
+ </xs:restriction>
289
+ </xs:simpleType>
290
+ <xs:simpleType name="SONOType">
291
+ <xs:annotation>
292
+ <xs:documentation>Код Классификатора системы обозначений налоговых органов</xs:documentation>
293
+ <xs:documentation>Содержит только цифры</xs:documentation>
294
+ </xs:annotation>
295
+ <xs:restriction base="xs:string">
296
+ <xs:length value="4"/>
297
+ <xs:pattern value="\d{4}"/>
298
+ </xs:restriction>
299
+ </xs:simpleType>
300
+ <xs:simpleType name="SPDULTemplateType">
301
+ <xs:annotation>
302
+ <xs:documentation>Шаблон серии, номера из Справочника видов документов, удостоверяющих личность налогоплательщика</xs:documentation>
303
+ </xs:annotation>
304
+ <xs:restriction base="xs:string">
305
+ <xs:minLength value="1"/>
306
+ <xs:maxLength value="25"/>
307
+ </xs:restriction>
308
+ </xs:simpleType>
309
+ <xs:simpleType name="SPDULType">
310
+ <xs:annotation>
311
+ <xs:documentation>Код Справочника видов документов, удостоверяющих личность налогоплательщика</xs:documentation>
312
+ <xs:documentation>Содержит только цифры</xs:documentation>
313
+ </xs:annotation>
314
+ <xs:restriction base="xs:string">
315
+ <xs:length value="2"/>
316
+ <xs:pattern value="\d{2}"/>
317
+ </xs:restriction>
318
+ </xs:simpleType>
319
+ <xs:simpleType name="SNILSType">
320
+ <xs:annotation>
321
+ <xs:documentation>СНИЛС</xs:documentation>
322
+ </xs:annotation>
323
+ <xs:restriction base="xs:string">
324
+ <xs:length value="11"/>
325
+ <xs:pattern value="\d{11}"/>
326
+ </xs:restriction>
327
+ </xs:simpleType>
328
+ <xs:simpleType name="SSRFType">
329
+ <xs:annotation>
330
+ <xs:documentation>Код по Справочнику субъектов Российской Федерации</xs:documentation>
331
+ </xs:annotation>
332
+ <xs:restriction base="fns:digits-2"/>
333
+ </xs:simpleType>
334
+ <xs:simpleType name="string-1000">
335
+ <xs:annotation>
336
+ <xs:documentation>Произвольный текст длиной от 1 до 1000 символов</xs:documentation>
337
+ </xs:annotation>
338
+ <xs:restriction base="xs:string">
339
+ <xs:minLength value="1"/>
340
+ <xs:maxLength value="1000"/>
341
+ </xs:restriction>
342
+ </xs:simpleType>
343
+ <xs:simpleType name="string-255">
344
+ <xs:annotation>
345
+ <xs:documentation>Произвольный текст длиной от 1 до 255 символов</xs:documentation>
346
+ </xs:annotation>
347
+ <xs:restriction base="xs:string">
348
+ <xs:maxLength value="255"/>
349
+ <xs:minLength value="1"/>
350
+ </xs:restriction>
351
+ </xs:simpleType>
352
+ <xs:simpleType name="string-100">
353
+ <xs:annotation>
354
+ <xs:documentation>Произвольный текст длиной от 1 до 100 символов</xs:documentation>
355
+ </xs:annotation>
356
+ <xs:restriction base="xs:string">
357
+ <xs:maxLength value="100"/>
358
+ <xs:minLength value="1"/>
359
+ </xs:restriction>
360
+ </xs:simpleType>
361
+ <xs:simpleType name="string-60">
362
+ <xs:annotation>
363
+ <xs:documentation>Произвольный текст длиной от 1 до 60 символов</xs:documentation>
364
+ </xs:annotation>
365
+ <xs:restriction base="xs:string">
366
+ <xs:minLength value="1"/>
367
+ <xs:maxLength value="60"/>
368
+ </xs:restriction>
369
+ </xs:simpleType>
370
+ <xs:simpleType name="string-50">
371
+ <xs:annotation>
372
+ <xs:documentation>Произвольный текст длиной от 1 до 50 символов</xs:documentation>
373
+ </xs:annotation>
374
+ <xs:restriction base="xs:string">
375
+ <xs:maxLength value="50"/>
376
+ <xs:minLength value="1"/>
377
+ </xs:restriction>
378
+ </xs:simpleType>
379
+ <xs:simpleType name="string-36">
380
+ <xs:annotation>
381
+ <xs:documentation>Произвольный текст длиной от 1 до 36 символов</xs:documentation>
382
+ </xs:annotation>
383
+ <xs:restriction base="xs:string">
384
+ <xs:maxLength value="36"/>
385
+ <xs:minLength value="1"/>
386
+ </xs:restriction>
387
+ </xs:simpleType>
388
+ <xs:simpleType name="string-25">
389
+ <xs:annotation>
390
+ <xs:documentation>Произвольный текст длиной от 1 до 25 символов</xs:documentation>
391
+ </xs:annotation>
392
+ <xs:restriction base="xs:string">
393
+ <xs:maxLength value="25"/>
394
+ <xs:minLength value="1"/>
395
+ </xs:restriction>
396
+ </xs:simpleType>
397
+ <xs:simpleType name="string-20">
398
+ <xs:annotation>
399
+ <xs:documentation>Произвольный текст длиной от 1 до 20 символов</xs:documentation>
400
+ </xs:annotation>
401
+ <xs:restriction base="xs:string">
402
+ <xs:maxLength value="20"/>
403
+ <xs:minLength value="1"/>
404
+ </xs:restriction>
405
+ </xs:simpleType>
406
+ <xs:simpleType name="string-12">
407
+ <xs:annotation>
408
+ <xs:documentation>Произвольный текст длиной от 1 до 12 символов</xs:documentation>
409
+ </xs:annotation>
410
+ <xs:restriction base="xs:string">
411
+ <xs:maxLength value="12"/>
412
+ <xs:minLength value="1"/>
413
+ </xs:restriction>
414
+ </xs:simpleType>
415
+ <xs:simpleType name="string-10">
416
+ <xs:annotation>
417
+ <xs:documentation>Произвольный текст длиной от 1 до 10 символов</xs:documentation>
418
+ </xs:annotation>
419
+ <xs:restriction base="xs:string">
420
+ <xs:maxLength value="10"/>
421
+ <xs:minLength value="1"/>
422
+ </xs:restriction>
423
+ </xs:simpleType>
424
+ <xs:simpleType name="string-7">
425
+ <xs:annotation>
426
+ <xs:documentation>Текст длиной ровно 7 символов</xs:documentation>
427
+ </xs:annotation>
428
+ <xs:restriction base="xs:string">
429
+ <xs:length value="7"/>
430
+ </xs:restriction>
431
+ </xs:simpleType>
432
+ <xs:simpleType name="string-5">
433
+ <xs:annotation>
434
+ <xs:documentation>Текст длиной ровно 5 символов</xs:documentation>
435
+ </xs:annotation>
436
+ <xs:restriction base="xs:string">
437
+ <xs:length value="7"/>
438
+ </xs:restriction>
439
+ </xs:simpleType>
440
+ <xs:simpleType name="string-3">
441
+ <xs:annotation>
442
+ <xs:documentation>Текст длиной ровно 3 символа</xs:documentation>
443
+ </xs:annotation>
444
+ <xs:restriction base="xs:string">
445
+ <xs:length value="3"/>
446
+ </xs:restriction>
447
+ </xs:simpleType>
448
+ <xs:simpleType name="string-2">
449
+ <xs:annotation>
450
+ <xs:documentation>Текст длиной ровно 2 символа</xs:documentation>
451
+ </xs:annotation>
452
+ <xs:restriction base="xs:string">
453
+ <xs:length value="2"/>
454
+ </xs:restriction>
455
+ </xs:simpleType>
456
+ <xs:simpleType name="string-1">
457
+ <xs:annotation>
458
+ <xs:documentation>Текст длиной ровно 1 символ</xs:documentation>
459
+ </xs:annotation>
460
+ <xs:restriction base="xs:string">
461
+ <xs:length value="1"/>
462
+ </xs:restriction>
463
+ </xs:simpleType>
464
+ <xs:simpleType name="GUID">
465
+ <xs:annotation>
466
+ <xs:documentation>Глобально уникальный идентификатор (GUID), ровно 36 знаков</xs:documentation>
467
+ </xs:annotation>
468
+ <xs:restriction base="xs:string">
469
+ <xs:maxLength value="36"/>
470
+ <xs:minLength value="1"/>
471
+ <xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}"/>
472
+ </xs:restriction>
473
+ </xs:simpleType>
474
+ <xs:complexType name="AddressLocationType">
475
+ <xs:annotation>
476
+ <xs:documentation>Адрес в Российской Федерации</xs:documentation>
477
+ </xs:annotation>
478
+ <xs:attribute name="IndexPostal" type="fns:digits-6" use="optional">
479
+ <xs:annotation>
480
+ <xs:documentation>Почтовый индекс</xs:documentation>
481
+ </xs:annotation>
482
+ </xs:attribute>
483
+ <xs:attribute name="Region" type="fns:SSRFType" use="required">
484
+ <xs:annotation>
485
+ <xs:documentation>Код субъекта Российской Федерации</xs:documentation>
486
+ </xs:annotation>
487
+ </xs:attribute>
488
+ <xs:attribute name="District" type="fns:string-50" use="optional">
489
+ <xs:annotation>
490
+ <xs:documentation>Район</xs:documentation>
491
+ </xs:annotation>
492
+ </xs:attribute>
493
+ <xs:attribute name="Town" type="fns:string-50" use="optional">
494
+ <xs:annotation>
495
+ <xs:documentation>Город</xs:documentation>
496
+ </xs:annotation>
497
+ </xs:attribute>
498
+ <xs:attribute name="Locality" type="fns:string-50" use="optional">
499
+ <xs:annotation>
500
+ <xs:documentation>Населенный пункт</xs:documentation>
501
+ </xs:annotation>
502
+ </xs:attribute>
503
+ <xs:attribute name="Street" type="fns:string-50" use="optional">
504
+ <xs:annotation>
505
+ <xs:documentation>Улица</xs:documentation>
506
+ </xs:annotation>
507
+ </xs:attribute>
508
+ <xs:attribute name="House" type="fns:string-20" use="optional">
509
+ <xs:annotation>
510
+ <xs:documentation>Дом</xs:documentation>
511
+ </xs:annotation>
512
+ </xs:attribute>
513
+ <xs:attribute name="Housing" type="fns:string-20" use="optional">
514
+ <xs:annotation>
515
+ <xs:documentation>Корпус</xs:documentation>
516
+ </xs:annotation>
517
+ </xs:attribute>
518
+ <xs:attribute name="Apartment" type="fns:string-20" use="optional">
519
+ <xs:annotation>
520
+ <xs:documentation>Квартира</xs:documentation>
521
+ </xs:annotation>
522
+ </xs:attribute>
523
+ </xs:complexType>
524
+ </xs:schema>
@@ -0,0 +1,299 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- edited with XMLSpy v2007 sp2 (http://www.altova.com) by otdel (GNIVC FNS RF) -->
3
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn://x-artefacts-fns-dohflna/root/260-18/4.0.1" xmlns:fnst="urn://x-artefacts-fns-dohflna/types/4.0.1" targetNamespace="urn://x-artefacts-fns-dohflna/root/260-18/4.0.1" elementFormDefault="qualified" attributeFormDefault="unqualified">
4
+ <xs:import namespace="urn://x-artefacts-fns-dohflna/types/4.0.1" schemaLocation="./commons/fns-dohflna-types.xsd"/>
5
+ <xs:element name="DOHFLNARequest">
6
+ <xs:annotation>
7
+ <xs:documentation>Запрос в Федеральную налоговую службу о представлении сведений о доходах физических лиц, выплаченных налоговыми агентами</xs:documentation>
8
+ </xs:annotation>
9
+ <xs:complexType>
10
+ <xs:sequence>
11
+ <xs:element name="СвФЛ">
12
+ <xs:annotation>
13
+ <xs:documentation>Сведения о физическом лице</xs:documentation>
14
+ </xs:annotation>
15
+ <xs:complexType>
16
+ <xs:sequence>
17
+ <xs:element name="ФИОФЛ" type="fnst:PhysicalPersonNameType">
18
+ <xs:annotation>
19
+ <xs:documentation>Фамилия, имя, отчество физического лица</xs:documentation>
20
+ </xs:annotation>
21
+ </xs:element>
22
+ <xs:element name="УдЛичн" type="fnst:IdentityDocumentShortType">
23
+ <xs:annotation>
24
+ <xs:documentation>Сведения о документе, удостоверяющем личность физического лица</xs:documentation>
25
+ </xs:annotation>
26
+ </xs:element>
27
+ </xs:sequence>
28
+ <xs:attribute name="ДатаРожд" type="xs:date" use="required">
29
+ <xs:annotation>
30
+ <xs:documentation>Дата рождения</xs:documentation>
31
+ </xs:annotation>
32
+ </xs:attribute>
33
+ <xs:attribute name="ИННФЛ" type="fnst:PhysicalPersonINNType" use="optional">
34
+ <xs:annotation>
35
+ <xs:documentation>ИНН физического лица</xs:documentation>
36
+ </xs:annotation>
37
+ </xs:attribute>
38
+ <xs:attribute name="СНИЛС" type="fnst:SNILSType" use="optional">
39
+ <xs:annotation>
40
+ <xs:documentation>Страховой номер индивидуального лицевого счета</xs:documentation>
41
+ </xs:annotation>
42
+ </xs:attribute>
43
+ </xs:complexType>
44
+ </xs:element>
45
+ </xs:sequence>
46
+ <xs:attribute name="Id" use="required">
47
+ <xs:annotation>
48
+ <xs:documentation>Признак подписания запроса ЭП должностного лица (ЭП-СП)</xs:documentation>
49
+ </xs:annotation>
50
+ <xs:simpleType>
51
+ <xs:restriction base="fnst:string-25">
52
+ <xs:enumeration value="PERSONAL_SIGNATURE"/>
53
+ </xs:restriction>
54
+ </xs:simpleType>
55
+ </xs:attribute>
56
+ <xs:attribute name="ИдЗапрос" type="fnst:IDRequestType" use="optional">
57
+ <xs:annotation>
58
+ <xs:documentation>Идентификатор запроса, сформированный запрашивающей стороной</xs:documentation>
59
+ </xs:annotation>
60
+ </xs:attribute>
61
+ <xs:attribute name="ОтчетГод" type="xs:gYear" use="required">
62
+ <xs:annotation>
63
+ <xs:documentation>Отчетный налоговый период</xs:documentation>
64
+ <xs:documentation>
65
+ Год в формате ГГГГ</xs:documentation>
66
+ </xs:annotation>
67
+ </xs:attribute>
68
+ </xs:complexType>
69
+ </xs:element>
70
+ <xs:element name="DOHFLNAResponse">
71
+ <xs:annotation>
72
+ <xs:documentation>Ответ Федеральной налоговой службы на запрос о представлении сведений о доходах физических лиц, выплаченных налоговыми агентами</xs:documentation>
73
+ </xs:annotation>
74
+ <xs:complexType>
75
+ <xs:sequence>
76
+ <xs:element name="ДохФЛ">
77
+ <xs:annotation>
78
+ <xs:documentation>Сведения о доходах физического лица</xs:documentation>
79
+ </xs:annotation>
80
+ <xs:complexType>
81
+ <xs:sequence>
82
+ <xs:element name="ДохФЛ_НА" maxOccurs="unbounded">
83
+ <xs:annotation>
84
+ <xs:documentation>Сведения о доходах физического лица по справкам 2-НДФЛ по налоговому агенту и из налоговой декларации по налогу на прибыль организаций</xs:documentation>
85
+ </xs:annotation>
86
+ <xs:complexType>
87
+ <xs:sequence>
88
+ <xs:element name="ПолучДох">
89
+ <xs:annotation>
90
+ <xs:documentation>Данные о физическом лице - получателе дохода</xs:documentation>
91
+ </xs:annotation>
92
+ <xs:complexType>
93
+ <xs:sequence>
94
+ <xs:element name="ФИО" type="fnst:PhysicalPersonNameType">
95
+ <xs:annotation>
96
+ <xs:documentation>Фамилия, имя, отчество</xs:documentation>
97
+ </xs:annotation>
98
+ </xs:element>
99
+ <xs:element name="УдЛичнФЛ" type="fnst:IdentityDocumentShortType">
100
+ <xs:annotation>
101
+ <xs:documentation>Сведения о документе, удостоверяющем личность </xs:documentation>
102
+ </xs:annotation>
103
+ </xs:element>
104
+ </xs:sequence>
105
+ <xs:attribute name="ИННФЛ" type="fnst:PhysicalPersonINNType" use="optional">
106
+ <xs:annotation>
107
+ <xs:documentation>ИНН физического лица</xs:documentation>
108
+ </xs:annotation>
109
+ </xs:attribute>
110
+ <xs:attribute name="ДатаРожд" type="xs:date" use="required">
111
+ <xs:annotation>
112
+ <xs:documentation>Дата рождения</xs:documentation>
113
+ </xs:annotation>
114
+ </xs:attribute>
115
+ </xs:complexType>
116
+ </xs:element>
117
+ <xs:element name="СвНА">
118
+ <xs:annotation>
119
+ <xs:documentation>Сведения о налоговом агенте </xs:documentation>
120
+ </xs:annotation>
121
+ <xs:complexType>
122
+ <xs:choice>
123
+ <xs:element name="СвНАЮЛ">
124
+ <xs:annotation>
125
+ <xs:documentation>Сведения о налоговом агенте - организации</xs:documentation>
126
+ </xs:annotation>
127
+ <xs:complexType>
128
+ <xs:attribute name="НаимОрг" type="fnst:string-1000" use="required">
129
+ <xs:annotation>
130
+ <xs:documentation>Наименование организации</xs:documentation>
131
+ </xs:annotation>
132
+ </xs:attribute>
133
+ <xs:attribute name="ИННЮЛ" type="fnst:LegalPersonINNType" use="required">
134
+ <xs:annotation>
135
+ <xs:documentation>ИНН организации</xs:documentation>
136
+ </xs:annotation>
137
+ </xs:attribute>
138
+ <xs:attribute name="КПП" type="fnst:KPPType" use="required">
139
+ <xs:annotation>
140
+ <xs:documentation>КПП</xs:documentation>
141
+ </xs:annotation>
142
+ </xs:attribute>
143
+ </xs:complexType>
144
+ </xs:element>
145
+ <xs:element name="СвНАФЛ">
146
+ <xs:annotation>
147
+ <xs:documentation>Сведения о налоговом агенте - физическом лице</xs:documentation>
148
+ </xs:annotation>
149
+ <xs:complexType>
150
+ <xs:sequence>
151
+ <xs:element name="ФИО" type="fnst:PhysicalPersonNameType">
152
+ <xs:annotation>
153
+ <xs:documentation>Фамилия, имя, отчество физического лица</xs:documentation>
154
+ </xs:annotation>
155
+ </xs:element>
156
+ </xs:sequence>
157
+ <xs:attribute name="ИННФЛ" type="fnst:PhysicalPersonINNType" use="required">
158
+ <xs:annotation>
159
+ <xs:documentation>ИНН физического лица</xs:documentation>
160
+ </xs:annotation>
161
+ </xs:attribute>
162
+ </xs:complexType>
163
+ </xs:element>
164
+ </xs:choice>
165
+ </xs:complexType>
166
+ </xs:element>
167
+ <xs:choice>
168
+ <xs:element name="СведДох_2НДФЛ" maxOccurs="unbounded">
169
+ <xs:annotation>
170
+ <xs:documentation>Сведения о доходах физического лица по справкам 2-НДФЛ</xs:documentation>
171
+ </xs:annotation>
172
+ <xs:complexType>
173
+ <xs:sequence>
174
+ <xs:element name="ДохВыч" minOccurs="0">
175
+ <xs:annotation>
176
+ <xs:documentation>Доходы, облагаемые по ставке</xs:documentation>
177
+ </xs:annotation>
178
+ <xs:complexType>
179
+ <xs:sequence>
180
+ <xs:element name="СвСумДох" maxOccurs="unbounded">
181
+ <xs:annotation>
182
+ <xs:documentation>Сведения о суммах дохода по месяцам и кодам дохода</xs:documentation>
183
+ </xs:annotation>
184
+ <xs:complexType>
185
+ <xs:attribute name="Месяц" use="required">
186
+ <xs:annotation>
187
+ <xs:documentation>Месяц</xs:documentation>
188
+ </xs:annotation>
189
+ <xs:simpleType>
190
+ <xs:restriction base="fnst:digits-2">
191
+ <xs:enumeration value="01"/>
192
+ <xs:enumeration value="02"/>
193
+ <xs:enumeration value="03"/>
194
+ <xs:enumeration value="04"/>
195
+ <xs:enumeration value="05"/>
196
+ <xs:enumeration value="06"/>
197
+ <xs:enumeration value="07"/>
198
+ <xs:enumeration value="08"/>
199
+ <xs:enumeration value="09"/>
200
+ <xs:enumeration value="10"/>
201
+ <xs:enumeration value="11"/>
202
+ <xs:enumeration value="12"/>
203
+ </xs:restriction>
204
+ </xs:simpleType>
205
+ </xs:attribute>
206
+ <xs:attribute name="КодДоход" type="fnst:digits-4" use="required">
207
+ <xs:annotation>
208
+ <xs:documentation>Код дохода</xs:documentation>
209
+ </xs:annotation>
210
+ </xs:attribute>
211
+ <xs:attribute name="СумДоход" type="fnst:number-14_2" use="required">
212
+ <xs:annotation>
213
+ <xs:documentation>Сумма дохода</xs:documentation>
214
+ </xs:annotation>
215
+ </xs:attribute>
216
+ </xs:complexType>
217
+ </xs:element>
218
+ </xs:sequence>
219
+ </xs:complexType>
220
+ </xs:element>
221
+ <xs:element name="СГДНалПер" minOccurs="0">
222
+ <xs:annotation>
223
+ <xs:documentation>Общие суммы дохода по итогам налогового периода</xs:documentation>
224
+ </xs:annotation>
225
+ <xs:complexType>
226
+ <xs:attribute name="СумДохОбщ" type="fnst:number-14_2" use="required">
227
+ <xs:annotation>
228
+ <xs:documentation>Общая сумма дохода</xs:documentation>
229
+ </xs:annotation>
230
+ </xs:attribute>
231
+ <xs:attribute name="НалБаза" type="fnst:number-14_2" use="required">
232
+ <xs:annotation>
233
+ <xs:documentation>Налоговая база</xs:documentation>
234
+ </xs:annotation>
235
+ </xs:attribute>
236
+ </xs:complexType>
237
+ </xs:element>
238
+ </xs:sequence>
239
+ <xs:attribute name="Ставка" type="fnst:number-2" use="required">
240
+ <xs:annotation>
241
+ <xs:documentation>Ставка налога</xs:documentation>
242
+ </xs:annotation>
243
+ </xs:attribute>
244
+ </xs:complexType>
245
+ </xs:element>
246
+ <xs:element name="СведДох_НДПриб" maxOccurs="unbounded">
247
+ <xs:annotation>
248
+ <xs:documentation>Сведения о доходах физического лица из налоговой декларации по налогу на прибыль организаций</xs:documentation>
249
+ </xs:annotation>
250
+ <xs:complexType>
251
+ <xs:sequence>
252
+ <xs:element name="ДохНалПер" minOccurs="0">
253
+ <xs:annotation>
254
+ <xs:documentation>Общие суммы дохода по итогам налогового периода</xs:documentation>
255
+ </xs:annotation>
256
+ <xs:complexType>
257
+ <xs:attribute name="Ставка" type="fnst:number-2" use="required">
258
+ <xs:annotation>
259
+ <xs:documentation>Налоговая ставка (%)</xs:documentation>
260
+ </xs:annotation>
261
+ </xs:attribute>
262
+ <xs:attribute name="СумДохОбщ" type="fnst:number-17_2" use="required">
263
+ <xs:annotation>
264
+ <xs:documentation>Общая сумма дохода</xs:documentation>
265
+ </xs:annotation>
266
+ </xs:attribute>
267
+ <xs:attribute name="НалБаза" type="fnst:number-17_2" use="required">
268
+ <xs:annotation>
269
+ <xs:documentation>Налоговая база</xs:documentation>
270
+ </xs:annotation>
271
+ </xs:attribute>
272
+ </xs:complexType>
273
+ </xs:element>
274
+ </xs:sequence>
275
+ </xs:complexType>
276
+ </xs:element>
277
+ </xs:choice>
278
+ </xs:sequence>
279
+ </xs:complexType>
280
+ </xs:element>
281
+ </xs:sequence>
282
+ <xs:attribute name="ОтчетГод" type="xs:gYear" use="required">
283
+ <xs:annotation>
284
+ <xs:documentation>Отчетный налоговый период</xs:documentation>
285
+ <xs:documentation>
286
+ Год в формате ГГГГ</xs:documentation>
287
+ </xs:annotation>
288
+ </xs:attribute>
289
+ </xs:complexType>
290
+ </xs:element>
291
+ </xs:sequence>
292
+ <xs:attribute name="ИдЗапрос" type="fnst:IDRequestType" use="optional">
293
+ <xs:annotation>
294
+ <xs:documentation>Идентификатор запроса, сформированный запрашивающей стороной</xs:documentation>
295
+ </xs:annotation>
296
+ </xs:attribute>
297
+ </xs:complexType>
298
+ </xs:element>
299
+ </xs:schema>
package/test/test.js CHANGED
@@ -327,36 +327,100 @@ async function test_007_wsdl (fn) {
327
327
 
328
328
  async function test_008_schemata (fn) {
329
329
 
330
- const xs = await XMLSchemata.fromFile ('test/30017.xsd')
330
+ const xs = await XMLSchemata.fromFile ('test/fns-dohflna-ru-root.xsd')
331
331
 
332
332
  const data =
333
333
 
334
- {"FNSINNSingularRequest":
335
- {
336
- "СведЮЛ": {
337
- "ОГРН":"1037843048880",
338
- "ИННЮЛ":"7825497650",
339
- "НаимОрг":"Нагрузочное тестирование"
340
- },
341
- "СведФЛ": {
342
- "ДатаРожд":"1973-07-14",
343
- "МестоРожд":null,
344
- "ФИО":{
345
- "Фамилия":"ВАЛЕРЬЕВНА",
346
- "Имя":"1973-07-14",
347
- "Отчество":"1973-07-14"
334
+ {
335
+ "DOHFLNAResponse": {
336
+ "ИдЗапрос": "000000000000000000000000000000000001",
337
+
338
+
339
+ "ДохФЛ": {
340
+ "ОтчетГод": "2015",
341
+ "ДохФЛ_НА": [
342
+ {
343
+ "ПолучДох": {
344
+ "ИННФЛ": "100000000074",
345
+ "ДатаРожд": "1980-01-01",
346
+ "ФИО": {
347
+ "FamilyName": "ИВАНОВ",
348
+ "FirstName": "ИВАН",
349
+ "Patronymic": "ИВАНОВИЧ"
350
+ },
351
+ "УдЛичнФЛ": {
352
+ "DocumentCode": "21",
353
+ "SeriesNumber": "0000 000000"
354
+ }
355
+ },
356
+ "СвНА": {
357
+ "СвНАФЛ": {
358
+ "ИННФЛ": "100000000074",
359
+ "ФИО": {
360
+ "FamilyName": "ИВАНОВ",
361
+ "FirstName": "ИВАН",
362
+ "Patronymic": "ИВАНОВИЧ"
363
+ }
364
+ }
365
+ },
366
+ "СведДох_2НДФЛ": {
367
+ "Ставка": "13",
368
+ "ДохВыч": {
369
+ "СвСумДох": [
370
+ {
371
+ "Месяц": "01",
372
+ "КодДоход": "2000",
373
+ "СумДоход": "1000.12"
374
+ },
375
+ {
376
+ "Месяц": "02",
377
+ "КодДоход": "2000",
378
+ "СумДоход": "2000.12"
379
+ }
380
+ ]
381
+ },
382
+ "СГДНалПер": {
383
+ "СумДохОбщ": "3000.24",
384
+ "НалБаза": "3000.24"
385
+ }
386
+ }
348
387
  },
349
- "УдЛичнФЛ":{
350
- "КодВидДок":"21",
351
- "ВыдДок":"11",
352
- "КодВыдДок":"111 111",
353
- "ДатаДок":"2022-10-01",
354
- "СерНомДок":"11 11 111111"}
355
- },
356
- "ИдЗапрос":"7daf950d-d71c-ea20-eaa9-5096324ca3b3"
357
- }
358
- }
388
+ {
389
+ "ПолучДох": {
390
+ "ИННФЛ": "100000000074",
391
+ "ДатаРожд": "1980-01-01",
392
+ "ФИО": {
393
+ "FamilyName": "ИВАНОВ",
394
+ "FirstName": "ИВАН",
395
+ "Patronymic": "ИВАНОВИЧ"
396
+ },
397
+ "УдЛичнФЛ": {
398
+ "DocumentCode": "21",
399
+ "SeriesNumber": "0000 000000"
400
+ }
401
+ },
402
+ "СвНА": {
403
+ "СвНАЮЛ": {
404
+ "НаимОрг": "ООО ТЕСТ",
405
+ "ИННЮЛ": "1000000002",
406
+ "КПП": "010101001"
407
+ }
408
+ },
409
+ "СведДох_НДПриб": {
410
+ "ДохНалПер": {
411
+ "Ставка": "2",
412
+ "СумДохОбщ": "5000.11",
413
+ "НалБаза": "3000.11"
414
+ }
415
+ }
416
+ }
417
+ ]
418
+ }
419
+
359
420
 
421
+
422
+ }
423
+ }
360
424
 
361
425
 
362
426
  console.log (xs.stringify (data))