xml-toolkit 1.0.24 → 1.0.25
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 +4 -1
- package/package.json +1 -1
- package/test/test.js +5 -3
package/lib/XMLMarshaller.js
CHANGED
|
@@ -246,7 +246,7 @@ const XMLMarshaller = class {
|
|
|
246
246
|
to_string (v, type, restriction = {}) {
|
|
247
247
|
|
|
248
248
|
const carp = () => {throw new Error (`Invalid value for ${type} type: ${v} (${typeof v})`)}
|
|
249
|
-
|
|
249
|
+
|
|
250
250
|
switch (type) {
|
|
251
251
|
|
|
252
252
|
case 'boolean':
|
|
@@ -332,6 +332,9 @@ const XMLMarshaller = class {
|
|
|
332
332
|
if (typeof v === 'number') return fractionDigits ? v.toFixed (fractionDigits.value) : '' + v
|
|
333
333
|
carp ()
|
|
334
334
|
|
|
335
|
+
case 'QName':
|
|
336
|
+
if (typeof v === 'object' && 'localName' in v) v = this.ns.QName (v.localName, v.namespaceURI)
|
|
337
|
+
|
|
335
338
|
default:
|
|
336
339
|
return XML_ATTR.escape ('' + v)
|
|
337
340
|
|
package/package.json
CHANGED
package/test/test.js
CHANGED
|
@@ -480,8 +480,10 @@ function test_013_soap () {
|
|
|
480
480
|
|
|
481
481
|
*/
|
|
482
482
|
|
|
483
|
+
|
|
484
|
+
|
|
483
485
|
let Fault = {
|
|
484
|
-
faultcode: '
|
|
486
|
+
faultcode: {localName: 'Client', namespaceURI: 'http://schemas.xmlsoap.org/soap/envelope/'},
|
|
485
487
|
faultstring: 'Message does not have necessary info',
|
|
486
488
|
faultactor: 'http://gizmos.com/order',
|
|
487
489
|
detail: {
|
|
@@ -526,7 +528,7 @@ function test_013_soap () {
|
|
|
526
528
|
*/
|
|
527
529
|
|
|
528
530
|
console.log (xs11.stringify (soap11))
|
|
529
|
-
|
|
531
|
+
/*
|
|
530
532
|
const xs12 = new XMLSchemata ('test/soap-1.2.xsd')
|
|
531
533
|
|
|
532
534
|
Fault = {
|
|
@@ -554,7 +556,7 @@ function test_013_soap () {
|
|
|
554
556
|
}
|
|
555
557
|
|
|
556
558
|
console.log (xs12.stringify (soap12))
|
|
557
|
-
|
|
559
|
+
*/
|
|
558
560
|
}
|
|
559
561
|
|
|
560
562
|
|