@cntwg/xml-lib-js 0.0.20 → 0.0.22

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/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ #### *v0.0.22*
2
+
3
+ Pre-release version.
4
+
5
+ > - some fixes in `xmldoc-lib.js` module.
6
+
7
+ #### *v0.0.21*
8
+
9
+ Pre-release version.
10
+
11
+ > - some fixes in `xmldoc-lib.js` module;
12
+ > - added method `hasChild()` from `TXmlElementController` class;
13
+ > - removed constants `DEF_XML_PARSE_OPTIONS` and `DEF_XML_ROOT_ETAG_NAME` from `xmldoc-lib.js` module exports;
14
+ > - updated dependency on `@ygracs/xobj-lib-js` module to v0.0.14rc3.
15
+
1
16
  #### *v0.0.20*
2
17
 
3
18
  Pre-release version.
package/LICENSE CHANGED
@@ -1,9 +1,9 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2019-2023 Yuri Grachev
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019-2023 Yuri Grachev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/doc/xmldoc-lib.md CHANGED
@@ -1,6 +1,6 @@
1
- >|***rev.*:**|0.1.19|
1
+ >|***rev.*:**|0.1.20|
2
2
  >|:---|---:|
3
- >|date:|2023-02-14|
3
+ >|date:|2023-03-01|
4
4
 
5
5
  ## Introduction
6
6
 
@@ -183,6 +183,10 @@ The method received value that can be a string or an array. If value is an array
183
183
  or
184
184
  `[ <lang>, <textValue> ]`.
185
185
 
186
+ ##### **hasChild(name)**
187
+
188
+ This method checks whether or not a child element addressed by `name` is exists.
189
+
186
190
  ##### **getChild(name)**
187
191
 
188
192
  This method returns a child element addressed by `name`.
package/index.js CHANGED
@@ -1,31 +1,31 @@
1
- // [v0.1.007-20220722]
2
-
3
- // === module init block ===
4
-
5
- const xObj = require('@ygracs/xobj-lib-js');
6
- const xmldoc = require('./lib/xmldoc-lib.js');
7
-
8
- // === module extra block (helper functions) ===
9
-
10
- // === module main block ===
11
-
12
- // === module exports block ===
13
-
14
- exports.xObj = xObj;
15
-
16
- // will deprecate
17
- exports.DEF_XML_PARSE_OPTIONS = xmldoc.DEF_XML_PARSE_OPTIONS;
18
- // will deprecate
19
- exports.DEF_XML_ROOT_ETAG_NAME = xmldoc.DEF_XML_ROOT_ETAG_NAME;
20
-
21
- exports.XML_DEF_PARSE_OPTIONS = xmldoc.XML_DEF_PARSE_OPTIONS;
22
- exports.XML_DEF_ROOT_ETAG_NAME = xmldoc.XML_DEF_ROOT_ETAG_NAME;
23
-
24
- exports.TXmlContentParseOptions = xmldoc.TXmlContentParseOptions;
25
-
26
- exports.TXmlAttributesMapper = xmldoc.TXmlAttributesMapper;
27
- exports.TXmlElementController = xmldoc.TXmlElementController;
28
- exports.TXmlElementsListController = xmldoc.TXmlElementsListController;
29
- exports.TXmlContentDeclaration = xmldoc.TXmlContentDeclaration;
30
- exports.TXmlContentRootElement = xmldoc.TXmlContentRootElement;
31
- exports.TXmlContentContainer = xmldoc.TXmlContentContainer;
1
+ // [v0.1.009-20230316]
2
+
3
+ // === module init block ===
4
+
5
+ const xObj = require('@ygracs/xobj-lib-js');
6
+ const xmldoc = require('./lib/xmldoc-lib.js');
7
+
8
+ // === module extra block (helper functions) ===
9
+
10
+ // === module main block ===
11
+
12
+ // === module exports block ===
13
+
14
+ exports.xObj = xObj;
15
+
16
+ // will deprecate
17
+ exports.DEF_XML_PARSE_OPTIONS = xmldoc.XML_DEF_PARSE_OPTIONS;
18
+ // will deprecate
19
+ exports.DEF_XML_ROOT_ETAG_NAME = xmldoc.XML_DEF_ROOT_ETAG_NAME;
20
+
21
+ exports.XML_DEF_PARSE_OPTIONS = xmldoc.XML_DEF_PARSE_OPTIONS;
22
+ exports.XML_DEF_ROOT_ETAG_NAME = xmldoc.XML_DEF_ROOT_ETAG_NAME;
23
+
24
+ exports.TXmlContentParseOptions = xmldoc.TXmlContentParseOptions;
25
+
26
+ exports.TXmlAttributesMapper = xmldoc.TXmlAttributesMapper;
27
+ exports.TXmlElementController = xmldoc.TXmlElementController;
28
+ exports.TXmlElementsListController = xmldoc.TXmlElementsListController;
29
+ exports.TXmlContentDeclaration = xmldoc.TXmlContentDeclaration;
30
+ exports.TXmlContentRootElement = xmldoc.TXmlContentRootElement;
31
+ exports.TXmlContentContainer = xmldoc.TXmlContentContainer;
package/lib/xmldoc-lib.js CHANGED
@@ -1,4 +1,4 @@
1
- // [v0.1.053-20230214]
1
+ // [v0.1.066-20230317]
2
2
 
3
3
  // === module init block ===
4
4
 
@@ -66,12 +66,12 @@ class TXmlAttributesMapper {
66
66
  return isPlainObject(items) ? Object.entries(items) : [];
67
67
  }
68
68
 
69
- hasAttribute(value){
69
+ hasAttribute(name){
70
70
  let result = false;
71
71
  try {
72
72
  result = xObj.checkXObjAttribute(
73
73
  this.#_host,
74
- value,
74
+ name,
75
75
  this.#_options.settings.attributesKey,
76
76
  );
77
77
  } catch (err) {
@@ -81,12 +81,12 @@ class TXmlAttributesMapper {
81
81
  return result;
82
82
  }
83
83
 
84
- getAttribute(value){
84
+ getAttribute(name){
85
85
  let result = '';
86
86
  try {
87
87
  result = xObj.readXObjAttr(
88
88
  this.#_host,
89
- value,
89
+ name,
90
90
  this.#_options.settings.attributesKey,
91
91
  );
92
92
  } catch (err) {
@@ -112,24 +112,19 @@ class TXmlAttributesMapper {
112
112
  return result;
113
113
  }
114
114
 
115
- delAttribute(value){
116
- let name = '';
117
- if (
118
- typeof value !== 'string' || ((name = value.trim()) === '')
119
- ) {
120
- return false;
121
- };
122
- // // TODO: await implementation for class method provided by xObj
123
- let items = xObj.getXObjAttributes(
124
- this.#_host,
125
- this.#_options.settings.attributesKey,
126
- );
127
- let isSUCCEED = isPlainObject(items);
128
- if (isSUCCEED) {
129
- // // TODO: catch errors in strict mode
130
- isSUCCEED = delete items[name];
115
+ delAttribute(name){
116
+ let result = false;
117
+ try {
118
+ result = xObj.deleteXObjAttribute(
119
+ this.#_host,
120
+ name,
121
+ this.#_options.settings.attributesKey,
122
+ );
123
+ } catch (err) {
124
+ // // TODO: verify what error is thrown
125
+ result = false;
131
126
  };
132
- return isSUCCEED;
127
+ return result;
133
128
  }
134
129
 
135
130
  clear(){
@@ -244,42 +239,60 @@ class TXmlElementController {
244
239
  }
245
240
 
246
241
  setTextValue(value){
247
- value = valueToArray(value);
248
- let val_size = value.length;
249
- if (val_size === 1) {
250
- return xObj.writeXObjParam(
251
- this.#_host,
252
- value[0],
253
- this.#_parseOptions.settings.textKey,
254
- );
255
- } else if (val_size > 1) {
256
- if (xObj.writeXObjParam(
257
- this.#_host,
258
- value[1],
259
- this.#_parseOptions.settings.textKey,
260
- )) {
261
- return this.#_attributes.setAttribute(XML_LANG_ATTR_TNAME, value[0]);
242
+ const _value = valueToArray(value);
243
+ const len = _value.length;
244
+ if (len > 0) {
245
+ if (len === 1) {
246
+ return xObj.writeXObjParam(
247
+ this.#_host,
248
+ _value[0],
249
+ this.#_parseOptions.settings.textKey,
250
+ );
251
+ } else {
252
+ const [ lang, param ] = _value;
253
+ if (xObj.writeXObjParam(
254
+ this.#_host,
255
+ param,
256
+ this.#_parseOptions.settings.textKey,
257
+ )) {
258
+ return this.#_attributes.setAttribute(XML_LANG_ATTR_TNAME, lang);
259
+ };
262
260
  };
263
261
  };
264
262
  return false;
265
263
  }
266
264
 
267
- getChild(value){
268
- let name = '';
269
- if (
270
- typeof value !== 'string' || ((name = value.trim()) === '')
271
- ) {
272
- return null;
265
+ hasChild(name){
266
+ const _name = xObj.evalXObjEName(name);
267
+ let result = false;
268
+ if (typeof _name === 'string' && _name !== '') {
269
+ try {
270
+ result = isObject(xObj.getXObjElement(this.#_host, name));
271
+ } catch (err) {
272
+ // // TODO: [?] verify what error is thrown
273
+ throw err;
274
+ };
273
275
  };
274
- let item = xObj.getXObjElement(this.#_host, name);
275
- if (isArray(item)) {
276
- item = new TXmlElementsListController(item, this.#_options);
277
- } else if (isObject(item)) {
278
- item = new TXmlElementController(item, this.#_options);
279
- } else {
280
- item = null;
276
+ return result;
277
+ }
278
+
279
+ getChild(name){
280
+ const _name = xObj.evalXObjEName(name);
281
+ let result = null;
282
+ if (typeof _name === 'string' && _name !== '') {
283
+ try {
284
+ const item = xObj.getXObjElement(this.#_host, name);
285
+ if (isArray(item)) {
286
+ result = new TXmlElementsListController(item, this.#_options);
287
+ } else if (isObject(item)) {
288
+ result = new TXmlElementController(item, this.#_options);
289
+ };
290
+ } catch (err) {
291
+ // // TODO: [?] verify what error is thrown
292
+ throw err;
293
+ };
281
294
  };
282
- return item;
295
+ return result;
283
296
  }
284
297
 
285
298
  _getChildRaw(name){
@@ -294,23 +307,9 @@ class TXmlElementController {
294
307
  return item !== undefined ? item : null;
295
308
  }
296
309
 
297
- _setChildRaw(name, obj){
310
+ _setChildRaw(...args){
298
311
  //console.log('CHECK: TXmlElementController._setChildRaw() => was called...');
299
- let isSUCCEED = false; let item = null;
300
- if (isArray(obj)) {
301
- //console.log('CHECK: TXmlElementController._setChildRaw() => <obj> is array...');
302
- item = xObj.insertXObjEList(this.#_host, name, true);
303
- // load elements
304
- for (let element of obj) {
305
- if (isPlainObject(element)) item.push(element);
306
- };
307
- } else if (isObject(obj)) {
308
- //console.log('CHECK: TXmlElementController._setChildRaw() => <obj> is object...');
309
- item = xObj.insertXObjElement(this.#_host, name, true);
310
- // // TODO: set element
311
- };
312
- if (item) isSUCCEED = true;
313
- return isSUCCEED;
312
+ return TXmlElementController.__setChildRaw(this, ...args);
314
313
  }
315
314
 
316
315
  _addChildRaw(name){//}, obj){
@@ -325,38 +324,48 @@ class TXmlElementController {
325
324
  return result.isSucceed ? result.item : null;
326
325
  }
327
326
 
328
- addChild(value){
329
- let name = '';
330
- if (
331
- typeof value !== 'string' || ((name = value.trim()) === '')
332
- ) {
333
- return null;
327
+ addChild(name){
328
+ const _name = xObj.evalXObjEName(name);
329
+ let result = null;
330
+ if (typeof _name === 'string' && _name !== '') {
331
+ try {
332
+ let { item } = xObj.addXObjElement(this.#_host, name);
333
+ if (item) result = new TXmlElementController(item, this.#_options)
334
+ } catch (err) {
335
+ // // TODO: [?] verify what error is thrown
336
+ throw err;
337
+ };
334
338
  };
335
- const result = xObj.addXObjElement(this.#_host, name);
336
- return (
337
- result.isSucceed
338
- ? new TXmlElementController(result.item, this.#_options)
339
- : null
340
- );
339
+ return result;
341
340
  }
342
341
 
343
- delChild(value){
344
- let name = '';
345
- if (
346
- typeof value !== 'string' || ((name = value.trim()) === '')
347
- ) {
348
- return false;
349
- };
350
- let item = xObj.getXObjElement(this.#_host, name);
351
- if (isArray(item)) {
352
- //console.log('CHECK: TXmlElementController.delChild() => item.typeof() => [object Array]');
353
- } else if (isObject(item)) {
354
- return xObj.deleteXObjElement(this.#_host, name);
355
- } else {
356
- //console.log('CHECK: TXmlElementController.delChild() => item.typeof() => ['+typeof item+']');
357
- //console.log('CHECK: TXmlElementController.delChild() => item.value() => ['+item+']');
342
+ delChild(name){
343
+ const _name = xObj.evalXObjEName(name);
344
+ let isSUCCEED = false;
345
+ if (typeof _name === 'string' && _name !== '') {
346
+ try {
347
+ const item = xObj.getXObjElement(this.#_host, name);
348
+ let isACCEPTED = false;
349
+ if (isArray(item)) {
350
+ //console.log('CHECK: TXmlElementController.delChild() => item.typeof() => [object Array]');
351
+ if (item.length < 2) {
352
+ isACCEPTED = true;
353
+ } else {
354
+ //console.log('CHECK: TXmlElementController.delChild() => item.length() => ['+item.length+']');
355
+ };
356
+ } else if (isObject(item)) {
357
+ isACCEPTED = true;
358
+ } else {
359
+ //console.log('CHECK: TXmlElementController.delChild() => item.typeof() => ['+typeof item+']');
360
+ //console.log('CHECK: TXmlElementController.delChild() => item.value() => ['+item+']');
361
+ };
362
+ if (isACCEPTED) isSUCCEED = xObj.deleteXObjElement(this.#_host, name);
363
+ } catch (err) {
364
+ // // TODO: [?] verify what error is thrown
365
+ throw err;
366
+ };
358
367
  };
359
- return false;
368
+ return isSUCCEED;
360
369
  }
361
370
 
362
371
  clear(){
@@ -367,6 +376,28 @@ class TXmlElementController {
367
376
  return (item instanceof TXmlElementController) ? item.#_host : null;
368
377
  }
369
378
 
379
+ static __setChildRaw(node, name, obj){
380
+ //console.log('CHECK: TXmlElementController.__setChildRaw() => was called...');
381
+ let isSUCCEED = false;
382
+ if (node instanceof TXmlElementController) {
383
+ let item = null;
384
+ if (isArray(obj)) {
385
+ //console.log('CHECK: TXmlElementController.__setChildRaw() => <obj> is array...');
386
+ item = xObj.insertXObjEList(node.#_host, name, { force: true });
387
+ // load elements
388
+ for (let element of obj) {
389
+ if (isPlainObject(element)) item.push(element);
390
+ };
391
+ } else if (isObject(obj)) {
392
+ //console.log('CHECK: TXmlElementController.__setChildRaw() => <obj> is object...');
393
+ item = xObj.insertXObjElement(node.#_host, name, { force: true });
394
+ // // TODO: set element
395
+ };
396
+ if (item) isSUCCEED = true;
397
+ };
398
+ return isSUCCEED;
399
+ }
400
+
370
401
  static clear(obj){
371
402
  let item = TXmlElementController.__unwrap(obj);
372
403
  if (item) {
@@ -660,7 +691,7 @@ class TXmlContentRootElement extends TXmlElementController {
660
691
  const entries = Object.keys(obj);
661
692
  const len = entries.length;
662
693
  if (len === 0) {
663
- rootItem = xObj.insertXObjElement(obj, rootETagName, false);
694
+ rootItem = xObj.insertXObjElement(obj, rootETagName);
664
695
  } else {
665
696
  const {
666
697
  declarationKey,
@@ -692,13 +723,13 @@ class TXmlContentRootElement extends TXmlElementController {
692
723
  };
693
724
  };
694
725
  if (targetKey === '') {
695
- rootItem = xObj.insertXObjElement(obj, rootETagName, false);
726
+ rootItem = xObj.insertXObjElement(obj, rootETagName);
696
727
  } else {
697
728
  if (autoBindRoot) {
698
729
  rootItem = obj[targetKey];
699
730
  rootETagName = targetKey;
700
731
  if (!isPlainObject(rootItem)) {
701
- rootItem = xObj.insertXObjElement(obj, rootETagName, false);
732
+ rootItem = xObj.insertXObjElement(obj, rootETagName);
702
733
  };
703
734
  } else {
704
735
  throw new TypeError(`TXmlContentRootElement : ${XML_TE_NROOT_EMSG}`);
@@ -706,7 +737,7 @@ class TXmlContentRootElement extends TXmlElementController {
706
737
  };
707
738
  };
708
739
  } else if (!isPlainObject(rootItem)) {
709
- rootItem = xObj.insertXObjElement(obj, rootETagName, false);
740
+ rootItem = xObj.insertXObjElement(obj, rootETagName);
710
741
  };
711
742
  // init parent class instance
712
743
  super(rootItem, _options);
@@ -814,7 +845,7 @@ class TXmlContentContainer {
814
845
  try {
815
846
  result = xmlParser.js2xml(this.#_content, this.#_parseOptions.js2xml);
816
847
  } catch (err) {
817
- console.log('CHECK: TXmlContentContainer.saveToXMLString() => Error => '+err);
848
+ //console.log('CHECK: TXmlContentContainer.saveToXMLString() => Error => '+err);
818
849
  //isERR = true;
819
850
  throw err;
820
851
  };
@@ -844,9 +875,21 @@ class TXmlContentContainer {
844
875
  data.errEvent = 'OPS_IS_SUCCEED';
845
876
  resolve(data);
846
877
  }).catch(err => {
847
- console.log('CHECK: TXmlContentContainer.saveToFile() => Error => '+err);
848
- console.log('CHECK: TXmlContentContainer.saveToFile() => Error => '+err.code);
849
- reject(err);
878
+ switch (err.code) {
879
+ case 'ENOENT': {
880
+ data.isERR = true;
881
+ data.errEvent = err.code;
882
+ data.content = '';
883
+ resolve(data);
884
+ break;
885
+ }
886
+ default: {
887
+ console.log('CHECK: TXmlContentContainer.saveToFile() => Error => '+err);
888
+ console.log('CHECK: TXmlContentContainer.saveToFile() => Error => '+err.code);
889
+ reject(err);
890
+ break;
891
+ }
892
+ };
850
893
  });
851
894
  };
852
895
  });
@@ -870,9 +913,20 @@ class TXmlContentContainer {
870
913
  data.content = this.saveToXMLString();
871
914
  fs.writeFileSync(data.source, data.content, 'utf8');
872
915
  } catch (err) {
873
- console.log('CHECK: TXmlContentContainer.saveToFileSync() => Error => '+err);
874
- console.log('CHECK: TXmlContentContainer.saveToFileSync() => Error => '+err.code);
875
- throw err;
916
+ switch (err.code) {
917
+ case 'ENOENT': {
918
+ data.isERR = true;
919
+ data.errEvent = err.code;
920
+ data.content = '';
921
+ break;
922
+ }
923
+ default: {
924
+ console.log('CHECK: TXmlContentContainer.saveToFileSync() => Error => '+err);
925
+ console.log('CHECK: TXmlContentContainer.saveToFileSync() => Error => '+err.code);
926
+ throw err;
927
+ break;
928
+ }
929
+ };
876
930
  };
877
931
  };
878
932
  return data;
@@ -888,8 +942,8 @@ class TXmlContentContainer {
888
942
  isSUCCEED = this._bindContent(obj, this.#_options);
889
943
  };
890
944
  } catch (err) {
891
- console.log('CHECK: TXmlContentContainer.loadFromXMLString() => Error => '+err);
892
- console.log('CHECK: TXmlContentContainer.loadFromXMLString() => Error => '+err.code);
945
+ //console.log('CHECK: TXmlContentContainer.loadFromXMLString() => Error => '+err);
946
+ //console.log('CHECK: TXmlContentContainer.loadFromXMLString() => Error => '+err.code);
893
947
  throw err;
894
948
  };
895
949
  };
@@ -931,16 +985,18 @@ class TXmlContentContainer {
931
985
  }).catch(err => {
932
986
  switch (err.code) {
933
987
  case 'ENOENT':
934
- case 'EISDIR':
988
+ case 'EISDIR': {
935
989
  data.isERR = true;
936
990
  data.errEvent = err.code;
937
991
  resolve(data);
938
992
  break;
939
- default:
993
+ }
994
+ default: {
940
995
  console.log('CHECK: TXmlContentContainer.loadFromFile() => Error => '+err);
941
996
  console.log('CHECK: TXmlContentContainer.loadFromFile() => Error => '+err.code);
942
997
  reject(err);
943
998
  break;
999
+ }
944
1000
  };
945
1001
  });
946
1002
  };
@@ -978,15 +1034,17 @@ class TXmlContentContainer {
978
1034
  } catch (err) {
979
1035
  switch (err.code) {
980
1036
  case 'ENOENT':
981
- case 'EISDIR':
982
- data.isERR = true;
983
- data.errEvent = err.code;
984
- break;
985
- default:
986
- console.log('CHECK: TXmlContentContainer.loadFromFileSync() => Error => '+err);
987
- console.log('CHECK: TXmlContentContainer.loadFromFileSync() => Error => '+err.code);
988
- throw err;
989
- break;
1037
+ case 'EISDIR': {
1038
+ data.isERR = true;
1039
+ data.errEvent = err.code;
1040
+ break;
1041
+ }
1042
+ default: {
1043
+ console.log('CHECK: TXmlContentContainer.loadFromFileSync() => Error => '+err);
1044
+ console.log('CHECK: TXmlContentContainer.loadFromFileSync() => Error => '+err.code);
1045
+ throw err;
1046
+ break;
1047
+ }
990
1048
  };
991
1049
  };
992
1050
  };
@@ -1001,8 +1059,8 @@ class TXmlContentContainer {
1001
1059
 
1002
1060
  // === module exports block ===
1003
1061
 
1004
- exports.DEF_XML_PARSE_OPTIONS = XML_DEF_PARSE_OPTIONS; // will deprecate
1005
- exports.DEF_XML_ROOT_ETAG_NAME = XML_DEF_ROOT_ETAG_NAME; // will deprecate
1062
+ //exports.DEF_XML_PARSE_OPTIONS = XML_DEF_PARSE_OPTIONS; // will deprecate
1063
+ //exports.DEF_XML_ROOT_ETAG_NAME = XML_DEF_ROOT_ETAG_NAME; // will deprecate
1006
1064
 
1007
1065
  exports.XML_DEF_PARSE_OPTIONS = XML_DEF_PARSE_OPTIONS;
1008
1066
  exports.XML_DEF_ROOT_ETAG_NAME = XML_DEF_ROOT_ETAG_NAME;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntwg/xml-lib-js",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "description": "A library for handling an XML-documents",
5
5
  "author": "ygracs <cs70th-om@rambler.ru>",
6
6
  "license": "MIT",
@@ -31,7 +31,7 @@
31
31
  "dependencies": {
32
32
  "@ygracs/bsfoc-lib-js": "^0.1.2",
33
33
  "@ygracs/xml-js6": "^0.0.3-b",
34
- "@ygracs/xobj-lib-js": "^0.0.14-rc1"
34
+ "@ygracs/xobj-lib-js": "^0.0.14-rc3"
35
35
  },
36
36
  "devDependencies": {
37
37
  "jest": "^29.4.2"