xml-toolkit 1.0.13 → 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.
package/test/test.js CHANGED
@@ -325,6 +325,109 @@ async function test_007_wsdl (fn) {
325
325
 
326
326
  }
327
327
 
328
+ async function test_008_schemata (fn) {
329
+
330
+ const xs = await XMLSchemata.fromFile ('test/fns-dohflna-ru-root.xsd')
331
+
332
+ const data =
333
+
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
+ }
387
+ },
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
+
420
+
421
+
422
+ }
423
+ }
424
+
425
+
426
+ console.log (xs.stringify (data))
427
+
428
+ }
429
+
430
+
328
431
  async function main () {
329
432
 
330
433
  // await test_001_lexer_sync ('E05a.xml')
@@ -341,8 +444,9 @@ async function main () {
341
444
  // await test_003_emitter_sync ('soap.xml')
342
445
  // await test_004_schemata ()
343
446
  // await test_005_schemata ()
344
- // await test_006_schemata ()
345
- await test_007_wsdl ()
447
+ await test_006_schemata ()
448
+ // await test_007_wsdl ()
449
+ await test_008_schemata ()
346
450
 
347
451
  }
348
452