xml-toolkit 1.0.55 → 1.0.57

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.
@@ -111,7 +111,7 @@ const XMLMarshaller = class {
111
111
 
112
112
  if (data [XSI_TYPE]) {
113
113
  let d = {}; for (let k in data) d [k] = data [k]
114
- this.appendElementBody (this.schema.get (data [XSI_TYPE]), d)
114
+ this.appendContent (this.schema.getType (data [XSI_TYPE]), d)
115
115
  }
116
116
 
117
117
  if (type) return this.appendContent (this.xs.getType (type), data)
@@ -27,6 +27,8 @@ const XMLSchemata = class extends Map {
27
27
  new XMLSchemaXml (this)
28
28
  new XMLSchemaBuiltIn (this)
29
29
 
30
+ this.loadedFiles = new Set()
31
+
30
32
  this.addFile (fn)
31
33
 
32
34
  }
@@ -159,6 +161,10 @@ const XMLSchemata = class extends Map {
159
161
 
160
162
  addFile (fn, options = {}) {
161
163
 
164
+ if (this.loadedFiles.has (fn)) return
165
+
166
+ this.loadedFiles.add (fn)
167
+
162
168
  options.dirname = path.dirname (fn)
163
169
 
164
170
  const document = this.parser.process (fs.readFileSync (fn, 'utf-8'))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xml-toolkit",
3
- "version": "1.0.55",
3
+ "version": "1.0.57",
4
4
  "description": "XML parser, marshaller, SOAP adapter",
5
5
  "main": "index.js",
6
6
  "files": [