xml-toolkit 1.0.3 → 1.0.4

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.
@@ -41,7 +41,25 @@ const XMLMarshaller = class {
41
41
 
42
42
  const qName = this.ns.QName (name || this.schemaElement.name, this.schema.targetNamespace)
43
43
 
44
- const {complexType, sequence, choice, all} = this.schemaElement, group = sequence || choice || all
44
+ let {complexType, sequence, choice, all, type} = this.schemaElement, group = sequence || choice || all
45
+
46
+ if (type) {
47
+
48
+ type = this.xs.getByReference (type)
49
+
50
+ switch (type._type) {
51
+
52
+ case 'complexType':
53
+ complexType = type
54
+ break
55
+
56
+ case 'simpleType':
57
+ simpleType = type
58
+ break
59
+
60
+ }
61
+
62
+ }
45
63
 
46
64
  let buf = ['<' + qName]
47
65
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xml-toolkit",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Collection of classes for dealing with XML",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/test/test.js CHANGED
@@ -251,10 +251,20 @@ async function test_005_schemata (fn) {
251
251
 
252
252
  }, {info} = data.AppData
253
253
 
254
- const m = xs.createMarshaller ('AppDataChildDotation', 'http://smev.gosuslugi.ru/rev111111')
255
-
256
- console.log (m.stringify ({info}, 'AppData'))
257
-
254
+ // const m = xs.createMarshaller ('AppDataChildDotation', 'http://smev.gosuslugi.ru/rev111111')
255
+
256
+ console.log (xs.stringify (
257
+
258
+ {childDotation2Request: {
259
+ MessageData: {
260
+ AppData: {
261
+ info
262
+ }
263
+ }
264
+ }}
265
+
266
+ ))
267
+
258
268
  }
259
269
 
260
270
  async function main () {
@@ -271,7 +281,7 @@ async function main () {
271
281
  // await test_003_emitter_sync ('not-sa01.xml')
272
282
  // await test_003_emitter_sync ('ent.xml')
273
283
  // await test_003_emitter_sync ('soap.xml')
274
- await test_004_schemata ()
284
+ // await test_004_schemata ()
275
285
  await test_005_schemata ()
276
286
 
277
287
  }