xml-toolkit 1.0.51 → 1.0.52

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.
@@ -36,7 +36,18 @@ const XMLMarshaller = class {
36
36
 
37
37
  printer.reset ()
38
38
 
39
- this.appendElement (schemaElement, data, this.ns.QName (o.localName || attributes.name, targetNamespace))
39
+ try {
40
+
41
+ this.appendElement (schemaElement, data, this.ns.QName (o.localName || attributes.name, targetNamespace))
42
+
43
+ }
44
+ catch (cause) {
45
+
46
+ const {targetNamespace, attributes: {name}} = schemaElement
47
+
48
+ throw Error (`Cannot stringify ${JSON.stringify (data)} as ${name}#{${targetNamespace}}`, {cause})
49
+
50
+ }
40
51
 
41
52
  return printer.text
42
53
 
@@ -63,7 +63,7 @@ const XMLSchemata = class extends Map {
63
63
 
64
64
  getSimpleTypeClass (node) {
65
65
 
66
- for (const {localName, namespaceURI, attributes: {base}, children} of node.children)
66
+ if (node) for (const {localName, namespaceURI, attributes: {base}, children} of node.children)
67
67
 
68
68
  if (localName === 'restriction' && namespaceURI === XMLSchema.namespaceURI)
69
69
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xml-toolkit",
3
- "version": "1.0.51",
3
+ "version": "1.0.52",
4
4
  "description": "XML parser, marshaller, SOAP adapter",
5
5
  "main": "index.js",
6
6
  "files": [