xml-toolkit 1.0.58 → 1.0.60
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/lib/XMLMarshaller.js +2 -2
- package/lib/XMLSchema.js +7 -7
- package/package.json +1 -1
package/lib/XMLMarshaller.js
CHANGED
|
@@ -77,7 +77,7 @@ const XMLMarshaller = class {
|
|
|
77
77
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
if (data [XSI_TYPE]) {
|
|
80
|
+
if (data && data [XSI_TYPE]) {
|
|
81
81
|
|
|
82
82
|
let {targetNamespace} = this.xs.getSchemaByLocalName(data [XSI_TYPE])
|
|
83
83
|
|
|
@@ -109,7 +109,7 @@ const XMLMarshaller = class {
|
|
|
109
109
|
|
|
110
110
|
const {attributes: {type}, children} = node
|
|
111
111
|
|
|
112
|
-
if (data [XSI_TYPE]) {
|
|
112
|
+
if (data && data [XSI_TYPE]) {
|
|
113
113
|
let d = {}; for (let k in data) d [k] = data [k]
|
|
114
114
|
this.appendContent (this.schema.getType (data [XSI_TYPE]), d)
|
|
115
115
|
}
|
package/lib/XMLSchema.js
CHANGED
|
@@ -110,18 +110,18 @@ const XMLSchema = class extends Map {
|
|
|
110
110
|
const {localName} = node
|
|
111
111
|
|
|
112
112
|
for (const e of node.children) this.copyTargetNamespace (e, localName === 'schema')
|
|
113
|
-
|
|
113
|
+
|
|
114
114
|
const {formDefault} = this; if (!(localName in formDefault)) return
|
|
115
|
-
|
|
115
|
+
|
|
116
116
|
if (!force) {
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
if (form !== FORM_Q
|
|
117
|
+
|
|
118
|
+
const form = node.attributes?.form || formDefault [localName]
|
|
119
|
+
|
|
120
|
+
if (form !== FORM_Q) return
|
|
121
121
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
node.targetNamespace = this.targetNamespace
|
|
124
|
+
node.targetNamespace = this.targetNamespace
|
|
125
125
|
|
|
126
126
|
}
|
|
127
127
|
|