@denevads/dnv-smo 1.0.18 → 1.0.19
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/dist/smo.js +3 -1
- package/package.json +1 -1
- package/src/smo.ts +3 -1
package/dist/smo.js
CHANGED
|
@@ -626,7 +626,9 @@ var Utils = /** @class */ (function () {
|
|
|
626
626
|
// Funciones para XML to JSON
|
|
627
627
|
Utils.prototype.xmlToJSON = function (xml) {
|
|
628
628
|
var getxml = new DOMParser();
|
|
629
|
-
var
|
|
629
|
+
var sinSaltosYTabulaciones = xml.replace(/[\n\r\t]/g, '');
|
|
630
|
+
var sinEspaciosEntreTags = sinSaltosYTabulaciones.replace(/>\s*</g, '><');
|
|
631
|
+
var xmlDoc = getxml.parseFromString(sinEspaciosEntreTags, "text/xml");
|
|
630
632
|
// gets the JSON string
|
|
631
633
|
var json_str = this.jsonToStr(this.setJsonObj(xmlDoc));
|
|
632
634
|
// sets and returns the JSON object, if "rstr" undefined (not passed), else, returns JSON string
|
package/package.json
CHANGED
package/src/smo.ts
CHANGED
|
@@ -657,7 +657,9 @@ class Utils{
|
|
|
657
657
|
// Funciones para XML to JSON
|
|
658
658
|
xmlToJSON(xml:string) {
|
|
659
659
|
let getxml = new DOMParser();
|
|
660
|
-
let
|
|
660
|
+
let sinSaltosYTabulaciones = xml.replace(/[\n\r\t]/g, '');
|
|
661
|
+
let sinEspaciosEntreTags = sinSaltosYTabulaciones.replace(/>\s*</g, '><');
|
|
662
|
+
let xmlDoc = getxml.parseFromString(sinEspaciosEntreTags,"text/xml");
|
|
661
663
|
// gets the JSON string
|
|
662
664
|
let json_str = this.jsonToStr(this.setJsonObj(xmlDoc));
|
|
663
665
|
// sets and returns the JSON object, if "rstr" undefined (not passed), else, returns JSON string
|