diff --git a/CHANGELOG.md b/CHANGELOG.md index e2f68989..622bd526 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ Note: If you find missing information about particular minor version, that version must have been changed without any functional change in this library. +**⚠️ 4.0.0-beta.2 / 2021-11-19** +* rename `attrMap` to `attibutes` in parser output when `preserveOrder:true` +* supports unpairedTags + **⚠️ 4.0.0-beta.1 / 2021-11-18** * Parser returns an array now * to make the structure common diff --git a/docs/v4/2.XMLparseOptions.md b/docs/v4/2.XMLparseOptions.md index b6102efc..f1a15dbe 100644 --- a/docs/v4/2.XMLparseOptions.md +++ b/docs/v4/2.XMLparseOptions.md @@ -779,4 +779,33 @@ Output } ``` +## unpairedTags +Unpaired Tags are the tags which don't have matching closing tag. Eg `
` in HTML. You can parse unpaired tags by providing their list to the parser, validator and builder. + +Eg +```js +const xmlData = ` + + value + + + `; + +const options = { + unpairedTags: ["unpaired"] +}; +const parser = new XMLParser(options); +const output = parser.parse(xmlDataStr); +``` +Output +```json +{ + "rootNode": { + "tag": "value", + "empty": "", + "unpaired": "" + } +} +``` + [> Next: XmlBuilder](./3.XMLBuilder.md) diff --git a/docs/v4/3.XMLBuilder.md b/docs/v4/3.XMLBuilder.md index 1cc88011..a3d8644e 100644 --- a/docs/v4/3.XMLBuilder.md +++ b/docs/v4/3.XMLBuilder.md @@ -101,6 +101,47 @@ To customize the bahaviour of parsing the text value of a tag to the string valu ## textNodeName To recognize text value for a tag in the JS object so that they can be properly assigned to the tag. +## unpairedTags +Unpaired Tags are the tags which don't have matching closing tag. Eg `
` in HTML. You can parse unpaired tags by providing their list to the parser, validator and builder. + +Eg +```js +const xmlData = ` + + value + + + `; + +const options = { + // suppressEmptyNode: true, + unpairedTags: ["unpaired"] +}; +const parser = new XMLParser(options); +const result = parser.parse(xmlDataStr); + +const builder = new XMLBuilder(options); +const output = builder.build(result); +``` +Output +```xml + + value + + + +``` + +when you sets `suppressEmptyNode: true`; + +```xml + + value + + + +``` + # Restoring original XML **Example 1** @@ -239,4 +280,6 @@ Output ``` + + [> Next: XmlValidator](./4.XMLValidator.md) \ No newline at end of file diff --git a/docs/v4/4.XMLValidator.md b/docs/v4/4.XMLValidator.md index ebcf7189..28eb25d5 100644 --- a/docs/v4/4.XMLValidator.md +++ b/docs/v4/4.XMLValidator.md @@ -35,4 +35,16 @@ const result = XMLValidator.validate(xmlData, { ## Options -The only option supported by Validator is `allowBooleanAttributes`. You need to set it to `true` when a tag can have boolean attributes. \ No newline at end of file +### allowBooleanAttributes + +Set it to `true` when a tag can have boolean attributes. + +### unpairedTags +Unpaired Tags are the tags which don't have matching closing tag. Eg `
` in HTML. You can parse unpaired tags by providing their list to the parser, validator and builder. + +```js +const xmlData = ``; +const result = XMLValidator.validate( xmlData, { + unpairedTags: ["extra"] +}); +``` \ No newline at end of file diff --git a/lib/fxparser.js b/lib/fxparser.js index db4fbd69..78ccf3ac 100644 --- a/lib/fxparser.js +++ b/lib/fxparser.js @@ -258,8 +258,8 @@ var buildOptions=function buildOptions(options,defaultOptions,props){var newOpti /***/ (function(module, exports, __webpack_require__) { "use strict"; -var util=__webpack_require__(/*! ./util */ "./src/util.js");var defaultOptions={allowBooleanAttributes:false//A tag can have attributes without any value -};var props=['allowBooleanAttributes'];//const tagsPattern = new RegExp("<\\/?([\\w:\\-_\.]+)\\s*\/?>","g"); +var util=__webpack_require__(/*! ./util */ "./src/util.js");var defaultOptions={allowBooleanAttributes:false,//A tag can have attributes without any value +unpairedTags:[]};var props=['allowBooleanAttributes','unpairedTags'];//const tagsPattern = new RegExp("<\\/?([\\w:\\-_\.]+)\\s*\/?>","g"); exports.validate=function(xmlData,options){options=util.buildOptions(options,defaultOptions,props);//xmlData = xmlData.replace(/(\r\n|\n|\r)/gm,"");//make it single line //xmlData = xmlData.replace(/(^\s*<\?xml.*?\?>)/g,"");//Remove XML starting tag //xmlData = xmlData.replace(/()/g,"");//Remove DOCTYPE @@ -282,7 +282,8 @@ if(tags.length==0){reachedRoot=true;}}}else{var _isValid=validateAttributeString //in order to get the 'true' error line, we need to calculate the position where the attribute begins (i - attrStr.length) and then add the position within the attribute //this gives us the absolute index in the entire xml, which we can use to find the line at last return getErrorObject(_isValid.err.code,_isValid.err.msg,getLineNumberForPosition(xmlData,i-attrStr.length+_isValid.err.line));}//if the root level has been reached before ... -if(reachedRoot===true){return getErrorObject('InvalidXml','Multiple possible root nodes found.',getLineNumberForPosition(xmlData,i));}else{tags.push({tagName:tagName,tagStartPos:tagStartPos});}tagFound=true;}//skip tag text value +if(reachedRoot===true){return getErrorObject('InvalidXml','Multiple possible root nodes found.',getLineNumberForPosition(xmlData,i));}else if(options.unpairedTags.indexOf(tagName)!==-1){//don't push into stack +}else{tags.push({tagName:tagName,tagStartPos:tagStartPos});}tagFound=true;}//skip tag text value //It may include comments and CDATA value for(i++;i\n';this.newLine='\n';}else{this.indentate=function(){return'';};this.tagEndChar='>';this.newLine='';}if(this.options.suppressEmptyNode){this.buildTextNode=buildEmptyTextNode;this.buildObjNode=buildEmptyObjNode;}else{this.buildTextNode=buildTextValNode;this.buildObjNode=buildObjectNode;}this.buildTextValNode=buildTextValNode;this.buildObjectNode=buildObjectNode;}Builder.prototype.build=function(jObj){if(this.options.preserveOrder){return buildFromOrderedJs(jObj,this.options);}else{if(Array.isArray(jObj)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1){var _jObj;jObj=(_jObj={},_jObj[this.options.arrayNodeName]=jObj,_jObj);}return this.j2x(jObj,0).val;}};Builder.prototype.j2x=function(jObj,level){var attrStr='';var val='';for(var key in jObj){if(typeof jObj[key]==='undefined'){// supress undefined node }else if(jObj[key]===null){val+=this.indentate(level)+'<'+key+'/'+this.tagEndChar;}else if(jObj[key]instanceof Date){val+=this.buildTextNode(jObj[key],key,'',level);}else if(typeof jObj[key]!=='object'){//premitive type var attr=this.isAttribute(key);if(attr){attrStr+=' '+attr+'="'+this.options.attributeValueProcessor(attr,''+jObj[key])+'"';}else{//tag value @@ -338,10 +339,7 @@ if(this.options.attributesGroupName&&key===this.options.attributesGroupName){var // + this.indentate(level) ''+this.options.tagValueProcessor(key,val)+''+this.options.tagValueProcessor(key,val)+'0){//TODO: this logic can be avoided for each call -indentation=EOL+""+options.indentBy.repeat(level);}for(var i=0;i");continue;}else if(tagName===options.commentPropName){xmlStr+=indentation+("");continue;}var attStr=attr_to_str(tagObj.attributes,options);var tagStart=indentation+("<"+tagName+attStr);var tagValue=arrToStr(tagObj[tagName],options,level+1);if((!tagValue||tagValue.length===0)&&options.suppressEmptyNode){xmlStr+=tagStart+"/>";}else{//TODO: node with only text value should not parse the text value in next line +indentation=EOL+""+options.indentBy.repeat(level);}for(var i=0;i");continue;}else if(tagName===options.commentPropName){xmlStr+=indentation+("");continue;}var attStr=attr_to_str(tagObj.attributes,options);var tagStart=indentation+("<"+tagName+attStr);var tagValue=arrToStr(tagObj[tagName],options,level+1);if((!tagValue||tagValue.length===0)&&options.suppressEmptyNode){if(options.unpairedTags.indexOf(tagName)!==-1){xmlStr+=tagStart+">";}else{xmlStr+=tagStart+"/>";}}else{//TODO: node with only text value should not parse the text value in next line xmlStr+=tagStart+(">"+tagValue+indentation+"");}}return xmlStr;}function propName(obj){var keys=Object.keys(obj);for(var i=0;i",i,"Closing Tag is not closed.");var tagName=xmlData.substring(i+2,closeIndex).trim();if(options.removeNSPrefix){var colonIndex=tagName.indexOf(":");if(colonIndex!==-1){tagName=tagName.substr(colonIndex+1);}}if(currentNode){textData=parseValue(textData,options,currentNode.tagname,jPath,false,currentNode.attrsMap?Object.keys(currentNode.attrsMap).length!==0:false,Object.keys(currentNode.child).length===0);if(textData!==undefined&&textData!=="")currentNode.add(options.textNodeName,textData);textData="";}if(isItStopNode(options.stopNodes,tagsNodeStack,currentNode.tagname)){var _ref;//TODO: namespace +var closeIndex=findClosingIndex(xmlData,">",i,"Closing Tag is not closed.");var tagName=xmlData.substring(i+2,closeIndex).trim();if(options.removeNSPrefix){var colonIndex=tagName.indexOf(":");if(colonIndex!==-1){tagName=tagName.substr(colonIndex+1);}}if(currentNode){textData=parseValue(textData,options,currentNode.tagname,jPath,false,currentNode.attributes?Object.keys(currentNode.attributes).length!==0:false,Object.keys(currentNode.child).length===0);if(textData!==undefined&&textData!=="")currentNode.add(options.textNodeName,textData);textData="";}if(isItStopNode(options.stopNodes,tagsNodeStack,currentNode.tagname)){var _ref;//TODO: namespace var top=tagsNodeStack[tagsNodeStack.length-1];var stopNode=top.child[top.child.length-1];stopNode[currentNode.tagname]=[(_ref={},_ref[options.textNodeName]=xmlData.substr(currentNode.startIndex+1,i-currentNode.startIndex-1),_ref)];}jPath=jPath.substr(0,jPath.lastIndexOf("."));currentNode=tagsNodeStack.pop();//avoid recurssion, set the parent tag scope textData="";i=closeIndex;}else if(xmlData[i+1]==='?'){i=findClosingIndex(xmlData,"?>",i,"Pi Tag is not closed.");}else if(xmlData.substr(i+1,3)==='!--'){var endIndex=findClosingIndex(xmlData,"-->",i,"Comment is not closed.");if(options.commentPropName){var _ref2;var comment=xmlData.substring(i+4,endIndex-2);//TODO: remove repeated code if(textData){//store previously collected data as textNode -textData=parseValue(textData,options,currentNode.tagname,jPath,false,currentNode.attrsMap?Object.keys(currentNode.attrsMap).length!==0:false,Object.keys(currentNode.child).length===0);if(textData!==undefined&&textData!=="")currentNode.add(options.textNodeName,textData);textData="";}currentNode.add(options.commentPropName,[(_ref2={},_ref2[options.textNodeName]=comment,_ref2)]);}i=endIndex;}else if(xmlData.substr(i+1,2)==='!D'){var _closeIndex=findClosingIndex(xmlData,">",i,"DOCTYPE is not closed.");var tagExp=xmlData.substring(i,_closeIndex);if(tagExp.indexOf("[")>=0){i=xmlData.indexOf("]>",i)+1;}else{i=_closeIndex;}}else if(xmlData.substr(i+1,2)==='!['){var _closeIndex2=findClosingIndex(xmlData,"]]>",i,"CDATA is not closed.")-2;var _tagExp=xmlData.substring(i+9,_closeIndex2);if(textData){//store previously collected data as textNode -textData=parseValue(textData,options,currentNode.tagname,jPath,false,currentNode.attrsMap?Object.keys(currentNode.attrsMap).length!==0:false,Object.keys(currentNode.child).length===0);if(textData!==undefined&&textData!=="")currentNode.add(options.textNodeName,textData);textData="";}//cdata should be set even if it is 0 length string +textData=parseValue(textData,options,currentNode.tagname,jPath,false,currentNode.attributes?Object.keys(currentNode.attributes).length!==0:false,Object.keys(currentNode.child).length===0);if(textData!==undefined&&textData!=="")currentNode.add(options.textNodeName,textData);textData="";}currentNode.add(options.commentPropName,[(_ref2={},_ref2[options.textNodeName]=comment,_ref2)]);}i=endIndex;}else if(xmlData.substr(i+1,2)==='!D'){var _closeIndex=findClosingIndex(xmlData,">",i,"DOCTYPE is not closed.");var tagExp=xmlData.substring(i,_closeIndex);if(tagExp.indexOf("[")>=0){i=xmlData.indexOf("]>",i)+1;}else{i=_closeIndex;}}else if(xmlData.substr(i+1,2)==='!['){var _closeIndex2=findClosingIndex(xmlData,"]]>",i,"CDATA is not closed.")-2;var _tagExp=xmlData.substring(i+9,_closeIndex2);if(textData){//store previously collected data as textNode +textData=parseValue(textData,options,currentNode.tagname,jPath,false,currentNode.attributes?Object.keys(currentNode.attributes).length!==0:false,Object.keys(currentNode.child).length===0);if(textData!==undefined&&textData!=="")currentNode.add(options.textNodeName,textData);textData="";}//cdata should be set even if it is 0 length string if(options.cdataPropName){var _ref3;var val=parseValue(_tagExp,options,options.cdataPropName,jPath+"."+options.cdataPropName,true,false,true);if(!val)val="";currentNode.add(options.cdataPropName,[(_ref3={},_ref3[options.textNodeName]=val,_ref3)]);}else{var _val=parseValue(_tagExp,options,currentNode.tagname,jPath,true,false,true);if(!_val)_val="";currentNode.add(options.textNodeName,_val);}i=_closeIndex2+2;}else{//Opening tag var result=tagExpWithClosingIndex(xmlData,i+1);var _tagExp2=result.data;var _closeIndex3=result.index;var separatorIndex=_tagExp2.search(/\s/);var _tagName=_tagExp2;var shouldBuildAttributesMap=true;if(separatorIndex!==-1){//separate tag name and attributes expression _tagName=_tagExp2.substr(0,separatorIndex).replace(/\s\s*$/,'');_tagExp2=_tagExp2.substr(separatorIndex+1);}if(options.removeNSPrefix){var _colonIndex=_tagName.indexOf(":");if(_colonIndex!==-1){_tagName=_tagName.substr(_colonIndex+1);shouldBuildAttributesMap=_tagName!==result.data.substr(_colonIndex+1);}}//save text as child node if(currentNode&&textData){if(currentNode.tagname!=='!xml'){//when nested tag is found -textData=parseValue(textData,options,currentNode.tagname,jPath,false,currentNode.attrsMap?Object.keys(currentNode.attrsMap).length!==0:false,false);if(textData!==undefined&&textData!=="")currentNode.add(options.textNodeName,textData);textData="";}}if(_tagName!==xmlObj.tagname){jPath+=jPath?"."+_tagName:_tagName;}if(_tagExp2.length>0&&_tagExp2.lastIndexOf("/")===_tagExp2.length-1){//selfClosing tag -if(_tagName[_tagName.length-1]==="/"){//remove trailing '/' -_tagName=_tagName.substr(0,_tagName.length-1);_tagExp2=_tagName;}else{_tagExp2=_tagExp2.substr(0,_tagExp2.length-1);}var childNode=new xmlNode(_tagName);if(_tagName!==_tagExp2&&shouldBuildAttributesMap){childNode.attrsMap=buildAttributesMap(_tagExp2,jPath,options);}jPath=jPath.substr(0,jPath.lastIndexOf("."));// tagsNodeStack.push(currentNode); -currentNode.addChild(childNode);}else{//opening tag -var _childNode=new xmlNode(_tagName);tagsNodeStack.push(currentNode);_childNode.startIndex=_closeIndex3;//for further processing -if(_tagName!==_tagExp2&&shouldBuildAttributesMap){_childNode.attrsMap=buildAttributesMap(_tagExp2,jPath,options);}currentNode.addChild(_childNode);currentNode=_childNode;}textData="";i=_closeIndex3;}}else{textData+=xmlData[i];}}return xmlObj.child;};//TODO: use jPath to simplify the logic +textData=parseValue(textData,options,currentNode.tagname,jPath,false,currentNode.attributes?Object.keys(currentNode.attributes).length!==0:false,false);if(textData!==undefined&&textData!=="")currentNode.add(options.textNodeName,textData);textData="";}}if(_tagName!==xmlObj.tagname){jPath+=jPath?"."+_tagName:_tagName;}//selfClosing tag +if(_tagExp2.length>0&&_tagExp2.lastIndexOf("/")===_tagExp2.length-1){if(_tagName[_tagName.length-1]==="/"){//remove trailing '/' +_tagName=_tagName.substr(0,_tagName.length-1);_tagExp2=_tagName;}else{_tagExp2=_tagExp2.substr(0,_tagExp2.length-1);}var childNode=new xmlNode(_tagName);if(_tagName!==_tagExp2&&shouldBuildAttributesMap){childNode.attributes=buildAttributesMap(_tagExp2,jPath,options);}jPath=jPath.substr(0,jPath.lastIndexOf("."));// tagsNodeStack.push(currentNode); +currentNode.addChild(childNode);}//boolean tags +else if(options.unpairedTags.indexOf(_tagName)!==-1){// tagExp = tagExp.substr(0, tagExp.length - 1); +var _childNode=new xmlNode(_tagName);if(_tagName!==_tagExp2&&shouldBuildAttributesMap){_childNode.attributes=buildAttributesMap(_tagExp2,jPath,options);}jPath=jPath.substr(0,jPath.lastIndexOf("."));// tagsNodeStack.push(currentNode); +currentNode.addChild(_childNode);}//opening tag +else{var _childNode2=new xmlNode(_tagName);tagsNodeStack.push(currentNode);_childNode2.startIndex=_closeIndex3;//for further processing +if(_tagName!==_tagExp2&&shouldBuildAttributesMap){_childNode2.attributes=buildAttributesMap(_tagExp2,jPath,options);}currentNode.addChild(_childNode2);currentNode=_childNode2;}textData="";i=_closeIndex3;}}else{textData+=xmlData[i];}}return xmlObj.child;};//TODO: use jPath to simplify the logic /** * * @param {string[]} stopNodes @@ -496,9 +498,9 @@ for(var i=0;i0){var _this$child$push2;this.child.push((_this$child$push2={},_this$child$push2[node.tagname]=node.child,_this$child$push2.attributes=node.attrsMap,_this$child$push2));}else{var _this$child$push3;this.child.push((_this$child$push3={},_this$child$push3[node.tagname]=node.child,_this$child$push3));}};return XmlNode;}();;module.exports=XmlNode; +this.child.push((_this$child$push={},_this$child$push[key]=val,_this$child$push));};_proto.addChild=function addChild(node){if(node.attributes&&Object.keys(node.attributes).length>0){var _this$child$push2;this.child.push((_this$child$push2={},_this$child$push2[node.tagname]=node.child,_this$child$push2.attributes=node.attributes,_this$child$push2));}else{var _this$child$push3;this.child.push((_this$child$push3={},_this$child$push3[node.tagname]=node.child,_this$child$push3));}};return XmlNode;}();;module.exports=XmlNode; /***/ }) diff --git a/lib/fxparser.js.map b/lib/fxparser.js.map index ec2bc884..dd72a40a 100644 --- a/lib/fxparser.js.map +++ b/lib/fxparser.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://fxparser/webpack/bootstrap","webpack://fxparser/./node_modules/os-browserify/browser.js","webpack://fxparser/./node_modules/strnum/strnum.js","webpack://fxparser/./src/fxp.js","webpack://fxparser/./src/util.js","webpack://fxparser/./src/validator.js","webpack://fxparser/./src/xmlbuilder/json2xml.js","webpack://fxparser/./src/xmlbuilder/orderedJs2Xml.js","webpack://fxparser/./src/xmlparser/OptionsBuilder.js","webpack://fxparser/./src/xmlparser/OrderedObjParser.js","webpack://fxparser/./src/xmlparser/XMLParser.js","webpack://fxparser/./src/xmlparser/node2json.js","webpack://fxparser/./src/xmlparser/xmlNode.js"],"names":["exports","endianness","hostname","location","loadavg","uptime","freemem","Number","MAX_VALUE","totalmem","cpus","type","release","navigator","appVersion","networkInterfaces","getNetworkInterfaces","arch","platform","tmpdir","tmpDir","EOL","homedir","hexRegex","numRegex","consider","hex","leadingZeros","decimalPoint","toNumber","str","options","Object","assign","trimmedStr","trim","skipLike","undefined","test","parseInt","match","exec","negative","num","eNotation","length","module","validator","require","XMLParser","XMLBuilder","XMLValidator","nameStartChar","nameChar","nameRegexp","regexName","RegExp","getAllMatches","string","regex","matches","allmatches","startIndex","lastIndex","len","index","push","isName","isExist","v","isEmptyObject","obj","keys","merge","target","a","arrayMode","i","getValue","buildOptions","defaultOptions","props","newOptions","util","allowBooleanAttributes","validate","xmlData","tags","tagFound","reachedRoot","substr","readPI","err","tagStartPos","readCommentAndCDATA","closingTag","tagName","substring","validateTagName","msg","getErrorObject","getLineNumberForPosition","result","readAttributeStr","attrStr","value","attrStrStart","isValid","validateAttributeString","code","line","tagClosed","otg","pop","openPos","col","afterAmp","validateAmpersand","isWhiteSpace","JSON","stringify","map","t","replace","char","start","tagname","angleBracketsCount","doubleQuote","singleQuote","startChar","validAttrStrRegxp","attrNames","getPositionFromMatch","attrName","validateAttrName","hasOwnProperty","validateNumberAmpersand","re","count","message","lineNumber","lines","split","buildFromOrderedJs","attributeNamePrefix","attributesGroupName","textNodeName","ignoreAttributes","cdataPropName","format","indentBy","suppressEmptyNode","tagValueProcessor","key","attributeValueProcessor","preserveOrder","commentPropName","Builder","isAttribute","attrPrefixLen","processTextOrObjNode","indentate","tagEndChar","newLine","buildTextNode","buildEmptyTextNode","buildObjNode","buildEmptyObjNode","buildTextValNode","buildObjectNode","prototype","build","jObj","Array","isArray","arrayNodeName","j2x","val","level","Date","attr","arrLen","j","item","Ks","L","object","indexOf","repeat","name","startsWith","toXml","jArray","arrToStr","arr","xmlStr","indentation","tagObj","propName","attStr","attr_to_str","attributes","tagStart","tagValue","attrMap","removeNSPrefix","parseTagValue","parseAttributeValue","trimValues","numberParseOptions","stopNodes","alwaysCreateTextNode","xmlNode","regx","window","parseFloat","parseValue","jPath","dontTrim","hasAttributes","isLeafNode","newval","_parseValue","trimmedVal","resolveNameSpace","prefix","charAt","shouldParse","attrsRegx","buildAttributesMap","attrs","oldVal","aName","newVal","attrCollection","parseToOrderedJsObj","xmlObj","currentNode","textData","tagsNodeStack","ch","closeIndex","findClosingIndex","colonIndex","attrsMap","child","add","isItStopNode","top","stopNode","lastIndexOf","endIndex","comment","tagExp","tagExpWithClosingIndex","data","separatorIndex","search","shouldBuildAttributesMap","childNode","addChild","currentTagName","matchingStopNodes","forEach","node","attrBoundary","errMsg","closingIndex","Error","prettify","parse","validationOption","toString","orderedResult","compress","text","compressedObj","property","newJpath","isLeaf","isLeafTag","assignAttributes","jpath","atrrName","propCount","XmlNode"],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1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CACD,CACF,CACF,CACF,CAED,QAASH,UAAT,CAAmBlN,GAAnB,CAAwBxC,OAAxB,CAAgC,CAC9B,GAAM8P,UAAS,CAAG7P,MAAM,CAACwC,IAAP,CAAYD,GAAZ,EAAiB1B,MAAnC,CACA,GAAIgP,SAAS,GAAK,CAAd,EAAoBA,SAAS,GAAK,CAAd,EAAmBtN,GAAG,CAACxC,OAAO,CAACoH,YAAT,CAA9C,CAAwE,MAAO,KAAP,CACxE,MAAO,MAAP,CACD,CACDnJ,OAAO,CAAC8Q,QAAR,CAAmBA,QAAnB,C;;;;;;;;;;;;GClGMgB,Q,yBACJ,iBAAYhK,OAAZ,CAAqB,CACnB,KAAKA,OAAL,CAAeA,OAAf,CACA,KAAKwH,KAAL,CAAa,EAAb,CAAiB;AACjB,KAAKD,QAAL,CAAgB,EAAhB,CAAoB;AACrB,C,oCACDE,G,CAAA,aAAI7F,GAAJ,CAAQwB,GAAR,CAAY,sBACV;AACA,KAAKoE,KAAL,CAAWpL,IAAX,uCAAmBwF,GAAnB,EAAyBwB,GAAzB,oBACD,C,QACDmF,Q,CAAA,kBAASI,IAAT,CAAe,CACb,GAAGA,IAAI,CAACpB,QAAL,EAAiBrN,MAAM,CAACwC,IAAP,CAAYiM,IAAI,CAACpB,QAAjB,EAA2BxM,MAA3B,CAAoC,CAAxD,CAA0D,uBACxD,KAAKyM,KAAL,CAAWpL,IAAX,yCAAoBuM,IAAI,CAAC3I,OAAzB,EAAmC2I,IAAI,CAACnB,KAAxC,mBAA+C5C,UAA/C,CAA2D+D,IAAI,CAACpB,QAAhE,qBACD,CAFD,IAEK,uBACH,KAAKC,KAAL,CAAWpL,IAAX,yCAAoBuM,IAAI,CAAC3I,OAAzB,EAAmC2I,IAAI,CAACnB,KAAxC,qBACD,CACF,C,oBACF,CAGDxM,MAAM,CAAC9C,OAAP,CAAiB8R,OAAjB,C","file":"./lib/fxparser.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/fxp.js\");\n","exports.endianness = function () { return 'LE' };\n\nexports.hostname = function () {\n if (typeof location !== 'undefined') {\n return location.hostname\n }\n else return '';\n};\n\nexports.loadavg = function () { return [] };\n\nexports.uptime = function () { return 0 };\n\nexports.freemem = function () {\n return Number.MAX_VALUE;\n};\n\nexports.totalmem = function () {\n return Number.MAX_VALUE;\n};\n\nexports.cpus = function () { return [] };\n\nexports.type = function () { return 'Browser' };\n\nexports.release = function () {\n if (typeof navigator !== 'undefined') {\n return navigator.appVersion;\n }\n return '';\n};\n\nexports.networkInterfaces\n= exports.getNetworkInterfaces\n= function () { return {} };\n\nexports.arch = function () { return 'javascript' };\n\nexports.platform = function () { return 'browser' };\n\nexports.tmpdir = exports.tmpDir = function () {\n return '/tmp';\n};\n\nexports.EOL = '\\n';\n\nexports.homedir = function () {\n\treturn '/'\n};\n","const hexRegex = /^[-+]?0x[a-fA-F0-9]+$/;\nconst numRegex = /^([\\-\\+])?(0*)(\\.[0-9]+([eE]\\-?[0-9]+)?|[0-9]+(\\.[0-9]+([eE]\\-?[0-9]+)?)?)$/;\n// const octRegex = /0x[a-z0-9]+/;\n// const binRegex = /0x[a-z0-9]+/;\n\nconst consider = {\n hex : true,\n leadingZeros: true,\n decimalPoint: \"\\.\",\n //skipLike: /regex/\n};\n\nfunction toNumber(str, options = {}){\n // const options = Object.assign({}, consider);\n // if(opt.leadingZeros === false){\n // options.leadingZeros = false;\n // }else if(opt.hex === false){\n // options.hex = false;\n // }\n\n options = Object.assign({}, consider, options );\n if(!str || typeof str !== \"string\" ) return str;\n \n let trimmedStr = str.trim();\n \n if(options.skipLike !== undefined && options.skipLike.test(trimmedStr)) return str;\n else if (options.hex && hexRegex.test(trimmedStr)) {\n return Number.parseInt(trimmedStr, 16);\n // } else if (options.parseOct && octRegex.test(str)) {\n // return Number.parseInt(val, 8);\n // }else if (options.parseBin && binRegex.test(str)) {\n // return Number.parseInt(val, 2);\n }else{\n //separate negative sign, leading zeros, and rest number\n const match = numRegex.exec(trimmedStr);\n if(match){\n const negative = match[1];\n const leadingZeros = match[2];\n const num = match[3]; //complete num\n const eNotation = match[4] || match[6];\n if(leadingZeros.length === 1 && num[0] === \".\") return Number(str);\n else if(!options.leadingZeros && leadingZeros.length > 0) return str;\n else return Number(trimmedStr);\n }else{ //non-numeric string\n return str;\n }\n }\n}\n\nmodule.exports = toNumber\n","'use strict';\n\nconst validator = require('./validator');\nconst XMLParser = require('./xmlparser/XMLParser');\nconst XMLBuilder = require('./xmlbuilder/json2xml');\n\nmodule.exports = {\n XMLParser: XMLParser,\n XMLValidator: validator,\n XMLBuilder: XMLBuilder\n}","'use strict';\n\nconst nameStartChar = ':A-Za-z_\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD';\nconst nameChar = nameStartChar + '\\\\-.\\\\d\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040';\nconst nameRegexp = '[' + nameStartChar + '][' + nameChar + ']*'\nconst regexName = new RegExp('^' + nameRegexp + '$');\n\nconst getAllMatches = function(string, regex) {\n const matches = [];\n let match = regex.exec(string);\n while (match) {\n const allmatches = [];\n allmatches.startIndex = regex.lastIndex - match[0].length;\n const len = match.length;\n for (let index = 0; index < len; index++) {\n allmatches.push(match[index]);\n }\n matches.push(allmatches);\n match = regex.exec(string);\n }\n return matches;\n};\n\nconst isName = function(string) {\n const match = regexName.exec(string);\n return !(match === null || typeof match === 'undefined');\n};\n\nexports.isExist = function(v) {\n return typeof v !== 'undefined';\n};\n\nexports.isEmptyObject = function(obj) {\n return Object.keys(obj).length === 0;\n};\n\n/**\n * Copy all the properties of a into b.\n * @param {*} target\n * @param {*} a\n */\nexports.merge = function(target, a, arrayMode) {\n if (a) {\n const keys = Object.keys(a); // will return an array of own properties\n const len = keys.length; //don't make it inline\n for (let i = 0; i < len; i++) {\n if (arrayMode === 'strict') {\n target[keys[i]] = [ a[keys[i]] ];\n } else {\n target[keys[i]] = a[keys[i]];\n }\n }\n }\n};\n/* exports.merge =function (b,a){\n return Object.assign(b,a);\n} */\n\nexports.getValue = function(v) {\n if (exports.isExist(v)) {\n return v;\n } else {\n return '';\n }\n};\n\n// const fakeCall = function(a) {return a;};\n// const fakeCallNoReturn = function() {};\n\nconst buildOptions = function(options, defaultOptions, props) {\n let newOptions = {};\n if (!options) {\n return defaultOptions; //if there are not options\n }\n\n for (let i = 0; i < props.length; i++) {\n if (options[props[i]] !== undefined) {\n newOptions[props[i]] = options[props[i]];\n } else {\n newOptions[props[i]] = defaultOptions[props[i]];\n }\n }\n return newOptions;\n};\n\nexports.buildOptions = buildOptions;\nexports.isName = isName;\nexports.getAllMatches = getAllMatches;\nexports.nameRegexp = nameRegexp;\n","'use strict';\n\nconst util = require('./util');\n\nconst defaultOptions = {\n allowBooleanAttributes: false, //A tag can have attributes without any value\n};\n\nconst props = ['allowBooleanAttributes'];\n\n//const tagsPattern = new RegExp(\"<\\\\/?([\\\\w:\\\\-_\\.]+)\\\\s*\\/?>\",\"g\");\nexports.validate = function (xmlData, options) {\n options = util.buildOptions(options, defaultOptions, props);\n\n //xmlData = xmlData.replace(/(\\r\\n|\\n|\\r)/gm,\"\");//make it single line\n //xmlData = xmlData.replace(/(^\\s*<\\?xml.*?\\?>)/g,\"\");//Remove XML starting tag\n //xmlData = xmlData.replace(/()/g,\"\");//Remove DOCTYPE\n const tags = [];\n let tagFound = false;\n\n //indicates that the root tag has been closed (aka. depth 0 has been reached)\n let reachedRoot = false;\n\n if (xmlData[0] === '\\ufeff') {\n // check for byte order mark (BOM)\n xmlData = xmlData.substr(1);\n }\n \n for (let i = 0; i < xmlData.length; i++) {\n\n if (xmlData[i] === '<' && xmlData[i+1] === '?') {\n i+=2;\n i = readPI(xmlData,i);\n if (i.err) return i;\n }else if (xmlData[i] === '<') {\n //starting of tag\n //read until you reach to '>' avoiding any '>' in attribute value\n let tagStartPos = i;\n i++;\n \n if (xmlData[i] === '!') {\n i = readCommentAndCDATA(xmlData, i);\n continue;\n } else {\n let closingTag = false;\n if (xmlData[i] === '/') {\n //closing tag\n closingTag = true;\n i++;\n }\n //read tagname\n let tagName = '';\n for (; i < xmlData.length &&\n xmlData[i] !== '>' &&\n xmlData[i] !== ' ' &&\n xmlData[i] !== '\\t' &&\n xmlData[i] !== '\\n' &&\n xmlData[i] !== '\\r'; i++\n ) {\n tagName += xmlData[i];\n }\n tagName = tagName.trim();\n //console.log(tagName);\n\n if (tagName[tagName.length - 1] === '/') {\n //self closing tag without attributes\n tagName = tagName.substring(0, tagName.length - 1);\n //continue;\n i--;\n }\n if (!validateTagName(tagName)) {\n let msg;\n if (tagName.trim().length === 0) {\n msg = \"Invalid space after '<'.\";\n } else {\n msg = \"Tag '\"+tagName+\"' is an invalid name.\";\n }\n return getErrorObject('InvalidTag', msg, getLineNumberForPosition(xmlData, i));\n }\n\n const result = readAttributeStr(xmlData, i);\n if (result === false) {\n return getErrorObject('InvalidAttr', \"Attributes for '\"+tagName+\"' have open quote.\", getLineNumberForPosition(xmlData, i));\n }\n let attrStr = result.value;\n i = result.index;\n\n if (attrStr[attrStr.length - 1] === '/') {\n //self closing tag\n const attrStrStart = i - attrStr.length;\n attrStr = attrStr.substring(0, attrStr.length - 1);\n const isValid = validateAttributeString(attrStr, options);\n if (isValid === true) {\n tagFound = true;\n //continue; //text may presents after self closing tag\n } else {\n //the result from the nested function returns the position of the error within the attribute\n //in order to get the 'true' error line, we need to calculate the position where the attribute begins (i - attrStr.length) and then add the position within the attribute\n //this gives us the absolute index in the entire xml, which we can use to find the line at last\n return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line));\n }\n } else if (closingTag) {\n if (!result.tagClosed) {\n return getErrorObject('InvalidTag', \"Closing tag '\"+tagName+\"' doesn't have proper closing.\", getLineNumberForPosition(xmlData, i));\n } else if (attrStr.trim().length > 0) {\n return getErrorObject('InvalidTag', \"Closing tag '\"+tagName+\"' can't have attributes or invalid starting.\", getLineNumberForPosition(xmlData, tagStartPos));\n } else {\n const otg = tags.pop();\n if (tagName !== otg.tagName) {\n let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos);\n return getErrorObject('InvalidTag',\n \"Expected closing tag '\"+otg.tagName+\"' (opened in line \"+openPos.line+\", col \"+openPos.col+\") instead of closing tag '\"+tagName+\"'.\",\n getLineNumberForPosition(xmlData, tagStartPos));\n }\n\n //when there are no more tags, we reached the root level.\n if (tags.length == 0) {\n reachedRoot = true;\n }\n }\n } else {\n const isValid = validateAttributeString(attrStr, options);\n if (isValid !== true) {\n //the result from the nested function returns the position of the error within the attribute\n //in order to get the 'true' error line, we need to calculate the position where the attribute begins (i - attrStr.length) and then add the position within the attribute\n //this gives us the absolute index in the entire xml, which we can use to find the line at last\n return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line));\n }\n\n //if the root level has been reached before ...\n if (reachedRoot === true) {\n return getErrorObject('InvalidXml', 'Multiple possible root nodes found.', getLineNumberForPosition(xmlData, i));\n } else {\n tags.push({tagName, tagStartPos});\n }\n tagFound = true;\n }\n\n //skip tag text value\n //It may include comments and CDATA value\n for (i++; i < xmlData.length; i++) {\n if (xmlData[i] === '<') {\n if (xmlData[i + 1] === '!') {\n //comment or CADATA\n i++;\n i = readCommentAndCDATA(xmlData, i);\n continue;\n } else if (xmlData[i+1] === '?') {\n i = readPI(xmlData, ++i);\n if (i.err) return i;\n } else{\n break;\n }\n } else if (xmlData[i] === '&') {\n const afterAmp = validateAmpersand(xmlData, i);\n if (afterAmp == -1)\n return getErrorObject('InvalidChar', \"char '&' is not expected.\", getLineNumberForPosition(xmlData, i));\n i = afterAmp;\n }else{\n if (reachedRoot === true && !isWhiteSpace(xmlData[i])) {\n return getErrorObject('InvalidXml', \"Extra text at the end\", getLineNumberForPosition(xmlData, i));\n }\n }\n } //end of reading tag text value\n if (xmlData[i] === '<') {\n i--;\n }\n }\n } else {\n if ( isWhiteSpace(xmlData[i])) {\n continue;\n }\n return getErrorObject('InvalidChar', \"char '\"+xmlData[i]+\"' is not expected.\", getLineNumberForPosition(xmlData, i));\n }\n }\n\n if (!tagFound) {\n return getErrorObject('InvalidXml', 'Start tag expected.', 1);\n }else if (tags.length == 1) {\n return getErrorObject('InvalidTag', \"Unclosed tag '\"+tags[0].tagName+\"'.\", getLineNumberForPosition(xmlData, tags[0].tagStartPos));\n }else if (tags.length > 0) {\n return getErrorObject('InvalidXml', \"Invalid '\"+\n JSON.stringify(tags.map(t => t.tagName), null, 4).replace(/\\r?\\n/g, '')+\n \"' found.\", {line: 1, col: 1});\n }\n\n return true;\n};\n\nfunction isWhiteSpace(char){\n return char === ' ' || char === '\\t' || char === '\\n' || char === '\\r';\n}\n/**\n * Read Processing insstructions and skip\n * @param {*} xmlData\n * @param {*} i\n */\nfunction readPI(xmlData, i) {\n const start = i;\n for (; i < xmlData.length; i++) {\n if (xmlData[i] == '?' || xmlData[i] == ' ') {\n //tagname\n const tagname = xmlData.substr(start, i - start);\n if (i > 5 && tagname === 'xml') {\n return getErrorObject('InvalidXml', 'XML declaration allowed only at the start of the document.', getLineNumberForPosition(xmlData, i));\n } else if (xmlData[i] == '?' && xmlData[i + 1] == '>') {\n //check if valid attribut string\n i++;\n break;\n } else {\n continue;\n }\n }\n }\n return i;\n}\n\nfunction readCommentAndCDATA(xmlData, i) {\n if (xmlData.length > i + 5 && xmlData[i + 1] === '-' && xmlData[i + 2] === '-') {\n //comment\n for (i += 3; i < xmlData.length; i++) {\n if (xmlData[i] === '-' && xmlData[i + 1] === '-' && xmlData[i + 2] === '>') {\n i += 2;\n break;\n }\n }\n } else if (\n xmlData.length > i + 8 &&\n xmlData[i + 1] === 'D' &&\n xmlData[i + 2] === 'O' &&\n xmlData[i + 3] === 'C' &&\n xmlData[i + 4] === 'T' &&\n xmlData[i + 5] === 'Y' &&\n xmlData[i + 6] === 'P' &&\n xmlData[i + 7] === 'E'\n ) {\n let angleBracketsCount = 1;\n for (i += 8; i < xmlData.length; i++) {\n if (xmlData[i] === '<') {\n angleBracketsCount++;\n } else if (xmlData[i] === '>') {\n angleBracketsCount--;\n if (angleBracketsCount === 0) {\n break;\n }\n }\n }\n } else if (\n xmlData.length > i + 9 &&\n xmlData[i + 1] === '[' &&\n xmlData[i + 2] === 'C' &&\n xmlData[i + 3] === 'D' &&\n xmlData[i + 4] === 'A' &&\n xmlData[i + 5] === 'T' &&\n xmlData[i + 6] === 'A' &&\n xmlData[i + 7] === '['\n ) {\n for (i += 8; i < xmlData.length; i++) {\n if (xmlData[i] === ']' && xmlData[i + 1] === ']' && xmlData[i + 2] === '>') {\n i += 2;\n break;\n }\n }\n }\n\n return i;\n}\n\nconst doubleQuote = '\"';\nconst singleQuote = \"'\";\n\n/**\n * Keep reading xmlData until '<' is found outside the attribute value.\n * @param {string} xmlData\n * @param {number} i\n */\nfunction readAttributeStr(xmlData, i) {\n let attrStr = '';\n let startChar = '';\n let tagClosed = false;\n for (; i < xmlData.length; i++) {\n if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) {\n if (startChar === '') {\n startChar = xmlData[i];\n } else if (startChar !== xmlData[i]) {\n //if vaue is enclosed with double quote then single quotes are allowed inside the value and vice versa\n } else {\n startChar = '';\n }\n } else if (xmlData[i] === '>') {\n if (startChar === '') {\n tagClosed = true;\n break;\n }\n }\n attrStr += xmlData[i];\n }\n if (startChar !== '') {\n return false;\n }\n\n return {\n value: attrStr,\n index: i,\n tagClosed: tagClosed\n };\n}\n\n/**\n * Select all the attributes whether valid or invalid.\n */\nconst validAttrStrRegxp = new RegExp('(\\\\s*)([^\\\\s=]+)(\\\\s*=)?(\\\\s*([\\'\"])(([\\\\s\\\\S])*?)\\\\5)?', 'g');\n\n//attr, =\"sd\", a=\"amit's\", a=\"sd\"b=\"saf\", ab cd=\"\"\n\nfunction validateAttributeString(attrStr, options) {\n //console.log(\"start:\"+attrStr+\":end\");\n\n //if(attrStr.trim().length === 0) return true; //empty string\n\n const matches = util.getAllMatches(attrStr, validAttrStrRegxp);\n const attrNames = {};\n\n for (let i = 0; i < matches.length; i++) {\n if (matches[i][1].length === 0) {\n //nospace before attribute name: a=\"sd\"b=\"saf\"\n return getErrorObject('InvalidAttr', \"Attribute '\"+matches[i][2]+\"' has no space in starting.\", getPositionFromMatch(matches[i]))\n } else if (matches[i][3] === undefined && !options.allowBooleanAttributes) {\n //independent attribute: ab\n return getErrorObject('InvalidAttr', \"boolean attribute '\"+matches[i][2]+\"' is not allowed.\", getPositionFromMatch(matches[i]));\n }\n /* else if(matches[i][6] === undefined){//attribute without value: ab=\n return { err: { code:\"InvalidAttr\",msg:\"attribute \" + matches[i][2] + \" has no value assigned.\"}};\n } */\n const attrName = matches[i][2];\n if (!validateAttrName(attrName)) {\n return getErrorObject('InvalidAttr', \"Attribute '\"+attrName+\"' is an invalid name.\", getPositionFromMatch(matches[i]));\n }\n if (!attrNames.hasOwnProperty(attrName)) {\n //check for duplicate attribute.\n attrNames[attrName] = 1;\n } else {\n return getErrorObject('InvalidAttr', \"Attribute '\"+attrName+\"' is repeated.\", getPositionFromMatch(matches[i]));\n }\n }\n\n return true;\n}\n\nfunction validateNumberAmpersand(xmlData, i) {\n let re = /\\d/;\n if (xmlData[i] === 'x') {\n i++;\n re = /[\\da-fA-F]/;\n }\n for (; i < xmlData.length; i++) {\n if (xmlData[i] === ';')\n return i;\n if (!xmlData[i].match(re))\n break;\n }\n return -1;\n}\n\nfunction validateAmpersand(xmlData, i) {\n // https://www.w3.org/TR/xml/#dt-charref\n i++;\n if (xmlData[i] === ';')\n return -1;\n if (xmlData[i] === '#') {\n i++;\n return validateNumberAmpersand(xmlData, i);\n }\n let count = 0;\n for (; i < xmlData.length; i++, count++) {\n if (xmlData[i].match(/\\w/) && count < 20)\n continue;\n if (xmlData[i] === ';')\n break;\n return -1;\n }\n return i;\n}\n\nfunction getErrorObject(code, message, lineNumber) {\n return {\n err: {\n code: code,\n msg: message,\n line: lineNumber.line || lineNumber,\n col: lineNumber.col,\n },\n };\n}\n\nfunction validateAttrName(attrName) {\n return util.isName(attrName);\n}\n\n// const startsWithXML = /^xml/i;\n\nfunction validateTagName(tagname) {\n return util.isName(tagname) /* && !tagname.match(startsWithXML) */;\n}\n\n//this function returns the line number for the character at the given index\nfunction getLineNumberForPosition(xmlData, index) {\n const lines = xmlData.substring(0, index).split(/\\r?\\n/);\n return {\n line: lines.length,\n\n // column number is last line's length + 1, because column numbering starts at 1:\n col: lines[lines.length - 1].length + 1\n };\n}\n\n//this function returns the position of the first character of match within attrStr\nfunction getPositionFromMatch(match) {\n return match.startIndex + match[1].length;\n}\n","'use strict';\n//parse Empty Node as self closing node\nconst buildOptions = require('../util').buildOptions;\nconst buildFromOrderedJs = require('./orderedJs2Xml');\n\nconst defaultOptions = {\n attributeNamePrefix: '@_',\n attributesGroupName: false,\n textNodeName: '#text',\n ignoreAttributes: true,\n cdataPropName: false,\n format: false,\n indentBy: ' ',\n suppressEmptyNode: false,\n tagValueProcessor: function(key, a) {\n return a;\n },\n attributeValueProcessor: function(attrName, a) {\n return a;\n },\n preserveOrder: false,\n commentPropName: false\n};\n\nconst props = [\n 'attributeNamePrefix',\n 'attributesGroupName',\n 'textNodeName',\n 'ignoreAttributes',\n 'cdataPropName',\n 'format',\n 'indentBy',\n 'suppressEmptyNode',\n 'tagValueProcessor',\n 'attributeValueProcessor',\n 'arrayNodeName', //when array as root\n 'preserveOrder',\n \"commentPropName\",\n // 'rootNodeName', //when jsObject have multiple properties on root level\n];\n\nfunction Builder(options) {\n this.options = buildOptions(options, defaultOptions, props);\n if (this.options.ignoreAttributes || this.options.attributesGroupName) {\n this.isAttribute = function(/*a*/) {\n return false;\n };\n } else {\n this.attrPrefixLen = this.options.attributeNamePrefix.length;\n this.isAttribute = isAttribute;\n }\n\n this.processTextOrObjNode = processTextOrObjNode\n\n if (this.options.format) {\n this.indentate = indentate;\n this.tagEndChar = '>\\n';\n this.newLine = '\\n';\n } else {\n this.indentate = function() {\n return '';\n };\n this.tagEndChar = '>';\n this.newLine = '';\n }\n\n if (this.options.suppressEmptyNode) {\n this.buildTextNode = buildEmptyTextNode;\n this.buildObjNode = buildEmptyObjNode;\n } else {\n this.buildTextNode = buildTextValNode;\n this.buildObjNode = buildObjectNode;\n }\n\n this.buildTextValNode = buildTextValNode;\n this.buildObjectNode = buildObjectNode;\n}\n\nBuilder.prototype.build = function(jObj) {\n if(this.options.preserveOrder){\n return buildFromOrderedJs(jObj, this.options);\n }else {\n if(Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1){\n jObj = {\n [this.options.arrayNodeName] : jObj\n }\n }\n return this.j2x(jObj, 0).val;\n }\n};\n\nBuilder.prototype.j2x = function(jObj, level) {\n let attrStr = '';\n let val = '';\n for (let key in jObj) {\n if (typeof jObj[key] === 'undefined') {\n // supress undefined node\n } else if (jObj[key] === null) {\n val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;\n } else if (jObj[key] instanceof Date) {\n val += this.buildTextNode(jObj[key], key, '', level);\n } else if (typeof jObj[key] !== 'object') {\n //premitive type\n const attr = this.isAttribute(key);\n if (attr) {\n attrStr += ' ' + attr + '=\"' + this.options.attributeValueProcessor(attr, '' + jObj[key]) + '\"';\n }else {\n //tag value\n if (key === this.options.textNodeName) {\n val += this.options.tagValueProcessor(key, '' + jObj[key]);\n } else {\n val += this.buildTextNode(jObj[key], key, '', level);\n }\n }\n } else if (Array.isArray(jObj[key])) {\n //repeated nodes\n const arrLen = jObj[key].length;\n for (let j = 0; j < arrLen; j++) {\n const item = jObj[key][j];\n if (typeof item === 'undefined') {\n // supress undefined node\n } else if (item === null) {\n val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;\n } else if (typeof item === 'object') {\n val += this.processTextOrObjNode(item, key, level)\n } else {\n val += this.buildTextNode(item, key, '', level);\n }\n }\n } else {\n //nested node\n if (this.options.attributesGroupName && key === this.options.attributesGroupName) {\n const Ks = Object.keys(jObj[key]);\n const L = Ks.length;\n for (let j = 0; j < L; j++) {\n attrStr += ' ' + Ks[j] + '=\"' + this.options.attributeValueProcessor(Ks[j], '' + jObj[key][Ks[j]]) + '\"';\n }\n } else {\n val += this.processTextOrObjNode(jObj[key], key, level)\n }\n }\n }\n return {attrStr: attrStr, val: val};\n};\n\nfunction processTextOrObjNode (object, key, level) {\n const result = this.j2x(object, level + 1);\n if (object[this.options.textNodeName] !== undefined && Object.keys(object).length === 1) {\n return this.buildTextNode(result.val, key, result.attrStr, level);\n } else {\n return this.buildObjNode(result.val, key, result.attrStr, level);\n }\n}\n\nfunction buildObjectNode(val, key, attrStr, level) {\n if (attrStr && val.indexOf('<') === -1) {\n return (\n this.indentate(level) +\n '<' +\n key +\n attrStr +\n '>' +\n val +\n //+ this.newLine\n // + this.indentate(level)\n '' +\n this.options.tagValueProcessor(key, val) +\n ' 0){//TODO: this logic can be avoided for each call\n indentation = EOL + \"\" + options.indentBy.repeat(level);\n }\n\n for (let i = 0; i < arr.length; i++) {\n const tagObj = arr[i];\n const tagName = propName(tagObj);\n\n if(tagName === options.textNodeName){\n xmlStr += indentation + options.tagValueProcessor( tagName, tagObj[tagName]);\n continue;\n }else if( tagName === options.cdataPropName){\n xmlStr += indentation + ``;\n continue;\n }else if( tagName === options.commentPropName){\n xmlStr += indentation + ``;\n continue;\n }\n const attStr = attr_to_str(tagObj.attributes, options);\n let tagStart = indentation + `<${tagName}${attStr}`;\n let tagValue = arrToStr(tagObj[tagName], options, level + 1);\n if( (!tagValue || tagValue.length === 0) && options.suppressEmptyNode){ \n xmlStr += tagStart + \"/>\"; \n }else{ \n //TODO: node with only text value should not parse the text value in next line\n xmlStr += tagStart + `>${tagValue}${indentation}` ;\n }\n }\n \n return xmlStr;\n}\n\nfunction propName(obj){\n const keys = Object.keys(obj);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if(key !== \"attributes\") return key;\n }\n }\n\nfunction attr_to_str(attrMap, options){\n let attrStr = \"\";\n if(attrMap && !options.ignoreAttributes){\n for( attr in attrMap){\n attrStr+= ` ${attr.substr(options.attributeNamePrefix.length)}=\"${options.attributeValueProcessor(attr, attrMap[attr])}\"`;\n }\n }\n return attrStr;\n}\n\nmodule.exports = toXml;","\nconst defaultOptions = {\n preserveOrder: false,\n attributeNamePrefix: '@_',\n attributesGroupName: false,\n textNodeName: '#text',\n ignoreAttributes: true,\n removeNSPrefix: false, // remove NS from tag name or attribute name if true\n allowBooleanAttributes: false, //a tag can have attributes without any value\n //ignoreRootElement : false,\n parseTagValue: true,\n parseAttributeValue: false,\n trimValues: true, //Trim string values of tag and attributes\n cdataPropName: false,\n numberParseOptions: {\n hex: true,\n leadingZeros: true\n },\n tagValueProcessor: function(tagName, val) {\n return val;\n },\n attributeValueProcessor: function(attrName, val) {\n return val;\n },\n stopNodes: [], //nested tags will not be parsed even for errors\n alwaysCreateTextNode: false,\n isArray: () => false,\n commentPropName: false,\n};\n \nconst props = [\n 'preserveOrder',\n 'attributeNamePrefix',\n 'attributesGroupName',\n 'textNodeName',\n 'ignoreAttributes',\n 'removeNSPrefix',\n 'allowBooleanAttributes',\n 'parseTagValue',\n 'parseAttributeValue',\n 'trimValues',\n 'cdataPropName',\n 'tagValueProcessor',\n 'attributeValueProcessor',\n 'numberParseOptions',\n 'stopNodes',\n 'alwaysCreateTextNode',\n 'isArray',\n 'commentPropName'\n];\n \nconst util = require('../util');\n\nconst buildOptions = function(options) {\n return util.buildOptions(options, defaultOptions, props);\n};\n\nexports.buildOptions = buildOptions;\nexports.defaultOptions = defaultOptions;\nexports.props = props;","'use strict';\n\nconst util = require('../util');\nconst xmlNode = require('./xmlNode');\nconst toNumber = require(\"strnum\");\n\nconst regx =\n '<((!\\\\[CDATA\\\\[([\\\\s\\\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\\\/)(NAME)\\\\s*>))([^<]*)'\n .replace(/NAME/g, util.nameRegexp);\n\n//const tagsRegx = new RegExp(\"<(\\\\/?[\\\\w:\\\\-\\._]+)([^>]*)>(\\\\s*\"+cdataRegx+\")*([^<]+)?\",\"g\");\n//const tagsRegx = new RegExp(\"<(\\\\/?)((\\\\w*:)?([\\\\w:\\\\-\\._]+))([^>]*)>([^<]*)(\"+cdataRegx+\"([^<]*))*([^<]+)?\",\"g\");\n\n//polyfill\nif (!Number.parseInt && window.parseInt) {\n Number.parseInt = window.parseInt;\n}\nif (!Number.parseFloat && window.parseFloat) {\n Number.parseFloat = window.parseFloat;\n}\n\n\n/**\n * @param {string} val\n * @param {object} options\n * @param {string} tagName\n * @param {string} jPath\n * @param {boolean} dontTrim\n * @param {boolean} hasAttributes\n * @param {boolean} isLeafNode\n */\nfunction parseValue(val, options, tagName, jPath, dontTrim, hasAttributes, isLeafNode) {\n if (val !== undefined) {\n if (options.trimValues && !dontTrim) {\n val = val.trim();\n }\n if(val.length > 0){\n const newval = options.tagValueProcessor(tagName, val, jPath, hasAttributes, isLeafNode);\n if(newval === null || newval === undefined){\n //don't parse\n return val;\n }else if(typeof newval !== typeof val || newval !== val){\n //overwrite\n return newval;\n }else if(options.trimValues){\n return _parseValue(val, options.parseTagValue, options.numberParseOptions);\n }else{\n const trimmedVal = val.trim();\n if(trimmedVal === val){\n return _parseValue(val, options.parseTagValue, options.numberParseOptions);\n }else{\n return val;\n }\n }\n }\n }\n}\n\nfunction resolveNameSpace(tagname, options) {\n if (options.removeNSPrefix) {\n const tags = tagname.split(':');\n const prefix = tagname.charAt(0) === '/' ? '/' : '';\n if (tags[0] === 'xmlns') {\n return '';\n }\n if (tags.length === 2) {\n tagname = prefix + tags[1];\n }\n }\n return tagname;\n}\n\nfunction _parseValue(val, shouldParse, options) {\n if (shouldParse && typeof val === 'string') {\n //console.log(options)\n const newval = val.trim();\n if(newval === 'true' ) return true;\n else if(newval === 'false' ) return false;\n else return toNumber(val, options);\n } else {\n if (util.isExist(val)) {\n return val;\n } else {\n return '';\n }\n }\n}\n\n//TODO: change regex to capture NS\n//const attrsRegx = new RegExp(\"([\\\\w\\\\-\\\\.\\\\:]+)\\\\s*=\\\\s*(['\\\"])((.|\\n)*?)\\\\2\",\"gm\");\nconst attrsRegx = new RegExp('([^\\\\s=]+)\\\\s*(=\\\\s*([\\'\"])([\\\\s\\\\S]*?)\\\\3)?', 'gm');\n\nfunction buildAttributesMap(attrStr, jPath, options) {\n if (!options.ignoreAttributes && typeof attrStr === 'string') {\n // attrStr = attrStr.replace(/\\r?\\n/g, ' ');\n //attrStr = attrStr || attrStr.trim();\n\n const matches = util.getAllMatches(attrStr, attrsRegx);\n const len = matches.length; //don't make it inline\n const attrs = {};\n for (let i = 0; i < len; i++) {\n const attrName = resolveNameSpace(matches[i][1], options);\n let oldVal = matches[i][4];\n const aName = options.attributeNamePrefix + attrName;\n if (attrName.length) {\n if (oldVal !== undefined) {\n if (options.trimValues) {\n oldVal = oldVal.trim();\n }\n \n const newVal = options.attributeValueProcessor(attrName, oldVal, jPath);\n if(newVal === null || newVal === undefined){\n //don't parse\n attrs[aName] = oldVal;\n }else if(typeof newVal !== typeof oldVal || newVal !== oldVal){\n //overwrite\n attrs[aName] = newVal;\n }else{\n //parse\n attrs[aName] = _parseValue(\n oldVal,\n options.parseAttributeValue,\n options.numberParseOptions\n );\n }\n } else if (options.allowBooleanAttributes) {\n attrs[aName] = true;\n }\n }\n }\n if (!Object.keys(attrs).length) {\n return;\n }\n if (options.attributesGroupName) {\n const attrCollection = {};\n attrCollection[options.attributesGroupName] = attrs;\n return attrCollection;\n }\n return attrs;\n }\n}\n\nconst parseToOrderedJsObj = function(xmlData, options) {\n xmlData = xmlData.replace(/\\r\\n?/g, \"\\n\");\n const xmlObj = new xmlNode('!xml');\n let currentNode = xmlObj;\n let textData = \"\";\n const tagsNodeStack = [];\n let jPath = \"\";\n\n for(let i=0; i< xmlData.length; i++){//for each char in XML data\n const ch = xmlData[i];\n if(ch === '<'){\n // const nextIndex = i+1;\n // const _2ndChar = xmlData[nextIndex];\n if( xmlData[i+1] === '/') {//Closing Tag\n const closeIndex = findClosingIndex(xmlData, \">\", i, \"Closing Tag is not closed.\")\n let tagName = xmlData.substring(i+2,closeIndex).trim();\n\n if(options.removeNSPrefix){\n const colonIndex = tagName.indexOf(\":\");\n if(colonIndex !== -1){\n tagName = tagName.substr(colonIndex+1);\n }\n }\n \n if(currentNode){\n textData = parseValue(textData\n , options\n , currentNode.tagname\n , jPath\n ,false\n , currentNode.attrsMap ? Object.keys(currentNode.attrsMap).length !== 0 : false\n , Object.keys(currentNode.child).length === 0);\n if(textData !== undefined && textData !== \"\") currentNode.add(options.textNodeName, textData);\n textData = \"\";\n }\n\n if (isItStopNode(options.stopNodes, tagsNodeStack, currentNode.tagname)) { //TODO: namespace\n const top = tagsNodeStack[tagsNodeStack.length - 1];\n const stopNode = top.child[ top.child.length -1 ];\n stopNode[currentNode.tagname] = [ { [options.textNodeName] :xmlData.substr(currentNode.startIndex + 1, i - currentNode.startIndex - 1) }];\n }\n \n jPath = jPath.substr(0, jPath.lastIndexOf(\".\"));\n \n currentNode = tagsNodeStack.pop();//avoid recurssion, set the parent tag scope\n textData = \"\";\n i = closeIndex;\n } else if( xmlData[i+1] === '?') {\n i = findClosingIndex(xmlData, \"?>\", i, \"Pi Tag is not closed.\")\n } else if(xmlData.substr(i + 1, 3) === '!--') {\n const endIndex = findClosingIndex(xmlData, \"-->\", i, \"Comment is not closed.\")\n if(options.commentPropName){\n const comment = xmlData.substring(i + 4, endIndex - 2);\n\n //TODO: remove repeated code\n if(textData){ //store previously collected data as textNode\n textData = parseValue(textData\n , options\n , currentNode.tagname\n , jPath\n ,false\n , currentNode.attrsMap ? Object.keys(currentNode.attrsMap).length !== 0 : false\n , Object.keys(currentNode.child).length === 0);\n \n if(textData !== undefined && textData !== \"\") currentNode.add(options.textNodeName, textData);\n textData = \"\";\n }\n currentNode.add(options.commentPropName, [ { [options.textNodeName] : comment } ]);\n }\n i = endIndex;\n } else if( xmlData.substr(i + 1, 2) === '!D') {\n const closeIndex = findClosingIndex(xmlData, \">\", i, \"DOCTYPE is not closed.\")\n const tagExp = xmlData.substring(i, closeIndex);\n if(tagExp.indexOf(\"[\") >= 0){\n i = xmlData.indexOf(\"]>\", i) + 1;\n }else{\n i = closeIndex;\n }\n }else if(xmlData.substr(i + 1, 2) === '![') {\n const closeIndex = findClosingIndex(xmlData, \"]]>\", i, \"CDATA is not closed.\") - 2;\n const tagExp = xmlData.substring(i + 9,closeIndex);\n\n if(textData){ //store previously collected data as textNode\n textData = parseValue(textData\n , options\n , currentNode.tagname\n , jPath\n ,false\n , currentNode.attrsMap ? Object.keys(currentNode.attrsMap).length !== 0 : false\n , Object.keys(currentNode.child).length === 0);\n\n if(textData !== undefined && textData !== \"\") currentNode.add(options.textNodeName, textData);\n textData = \"\";\n }\n\n //cdata should be set even if it is 0 length string\n if(options.cdataPropName){\n let val = parseValue(tagExp, options, options.cdataPropName, jPath + \".\" + options.cdataPropName, true, false, true);\n if(!val) val = \"\";\n currentNode.add(options.cdataPropName, [ { [options.textNodeName] : val } ]);\n }else{\n let val = parseValue(tagExp, options, currentNode.tagname, jPath, true, false, true);\n if(!val) val = \"\";\n currentNode.add(options.textNodeName, val);\n }\n \n i = closeIndex + 2;\n }else {//Opening tag\n const result = tagExpWithClosingIndex(xmlData, i+1)\n let tagExp = result.data;\n const closeIndex = result.index;\n const separatorIndex = tagExp.search(/\\s/);\n let tagName = tagExp;\n let shouldBuildAttributesMap = true;\n if(separatorIndex !== -1){//separate tag name and attributes expression\n tagName = tagExp.substr(0, separatorIndex).replace(/\\s\\s*$/, '');\n tagExp = tagExp.substr(separatorIndex + 1);\n }\n\n if(options.removeNSPrefix){\n const colonIndex = tagName.indexOf(\":\");\n if(colonIndex !== -1){\n tagName = tagName.substr(colonIndex+1);\n shouldBuildAttributesMap = tagName !== result.data.substr(colonIndex + 1);\n }\n }\n \n //save text as child node\n if (currentNode && textData) {\n if(currentNode.tagname !== '!xml'){\n //when nested tag is found\n textData = parseValue(textData\n , options\n , currentNode.tagname\n , jPath\n , false\n , currentNode.attrsMap ? Object.keys(currentNode.attrsMap).length !== 0 : false\n , false);\n if(textData !== undefined && textData !== \"\") currentNode.add(options.textNodeName, textData);\n textData = \"\";\n }\n }\n\n if(tagName !== xmlObj.tagname){\n jPath += jPath ? \".\" + tagName : tagName;\n }\n\n if(tagExp.length > 0 && tagExp.lastIndexOf(\"/\") === tagExp.length - 1){//selfClosing tag\n \n if(tagName[tagName.length - 1] === \"/\"){ //remove trailing '/'\n tagName = tagName.substr(0, tagName.length - 1);\n tagExp = tagName;\n }else{\n tagExp = tagExp.substr(0, tagExp.length - 1);\n }\n\n const childNode = new xmlNode(tagName);\n if(tagName !== tagExp && shouldBuildAttributesMap){\n childNode.attrsMap = buildAttributesMap(tagExp, jPath , options);\n }\n jPath = jPath.substr(0, jPath.lastIndexOf(\".\"));\n // tagsNodeStack.push(currentNode);\n currentNode.addChild(childNode);\n }else{//opening tag\n \n const childNode = new xmlNode( tagName);\n tagsNodeStack.push(currentNode);\n \n childNode.startIndex=closeIndex; //for further processing\n \n if(tagName !== tagExp && shouldBuildAttributesMap){\n childNode.attrsMap = buildAttributesMap(tagExp, jPath, options);\n }\n currentNode.addChild(childNode);\n currentNode = childNode;\n }\n textData = \"\";\n i = closeIndex;\n }\n }else{\n textData += xmlData[i];\n }\n }\n return xmlObj.child;\n}\n\n//TODO: use jPath to simplify the logic\n/**\n * \n * @param {string[]} stopNodes \n * @param {XmlNode[]} tagsNodeStack \n */\nfunction isItStopNode(stopNodes, tagsNodeStack, currentTagName){\n const matchingStopNodes = [];\n //filter the list of stopNodes as per current tag\n stopNodes.forEach( jPath => {\n if( jPath.substr( jPath.length - currentTagName.length) === currentTagName) matchingStopNodes.push(jPath);\n });\n\n if(matchingStopNodes.length > 0){\n let jPath = \"\";\n for (let i = 1; i < tagsNodeStack.length; i++) {\n const node = tagsNodeStack[i];\n jPath += \".\" + node.tagname;\n }\n jPath += \".\" + currentTagName;\n jPath = jPath.substr(1);\n for (let i = 0; i < matchingStopNodes.length; i++) {\n if(matchingStopNodes[i] === jPath) return true;\n }\n }else return false;\n}\n\n/**\n * Returns the tag Expression and where it is ending handling single-dobule quotes situation\n * @param {string} xmlData \n * @param {number} i starting index\n * @returns \n */\nfunction tagExpWithClosingIndex(xmlData, i){\n let attrBoundary;\n let tagExp = \"\";\n for (let index = i; index < xmlData.length; index++) {\n let ch = xmlData[index];\n if (attrBoundary) {\n if (ch === attrBoundary) attrBoundary = \"\";//reset\n } else if (ch === '\"' || ch === \"'\") {\n attrBoundary = ch;\n } else if (ch === '>') {\n return {\n data: tagExp,\n index: index\n }\n } else if (ch === '\\t') {\n ch = \" \"\n }\n tagExp += ch;\n }\n}\n\nfunction findClosingIndex(xmlData, str, i, errMsg){\n const closingIndex = xmlData.indexOf(str, i);\n if(closingIndex === -1){\n throw new Error(errMsg)\n }else{\n return closingIndex + str.length - 1;\n }\n}\n\nexports.parseToOrderedJsObj = parseToOrderedJsObj;\n","const { buildOptions} = require(\"./OptionsBuilder\");\nconst { parseToOrderedJsObj} = require(\"./OrderedObjParser\");\nconst { prettify} = require(\"./node2json\");\nconst validator = require('../validator');\n\nclass XMLParser{\n constructor(options){\n this.options = buildOptions(options);\n }\n /**\n * Parse XML dats to JS object \n * @param {string|Buffer} xmlData \n * @param {boolean|Object} validationOption \n */\n parse(xmlData,validationOption){\n if(typeof xmlData === \"string\"){\n }else if( xmlData.toString){\n xmlData = xmlData.toString();\n }else{\n throw new Error(\"XML data is accepted in String or Bytes[] form.\")\n }\n if( validationOption){\n if(validationOption === true) validationOption = {}; //validate with default options\n \n const result = validator.validate(xmlData, validationOption);\n if (result !== true) {\n throw Error( `${result.err.msg}:${result.err.line}:${result.err.col}` )\n }\n }\n const orderedResult = parseToOrderedJsObj(xmlData, this.options);\n if(this.options.preserveOrder || orderedResult === undefined) return orderedResult;\n else return prettify(orderedResult, this.options);\n }\n}\n\nmodule.exports = XMLParser;","'use strict';\n\n/**\n * \n * @param {array} node \n * @param {any} options \n * @returns \n */\nfunction prettify(node, options){\n return compress( node, options);\n}\n\n/**\n * \n * @param {array} arr \n * @param {object} options \n * @param {string} jPath \n * @returns object\n */\nfunction compress(arr, options, jPath){\n let text;\n const compressedObj = {};\n for (let i = 0; i < arr.length; i++) {\n const tagObj = arr[i];\n const property = propName(tagObj);\n let newJpath = \"\";\n if(jPath === undefined) newJpath = property;\n else newJpath = jPath + \".\" + property;\n\n if(property === options.textNodeName){\n if(text === undefined) text = tagObj[property];\n else text += \"\" + tagObj[property];\n }else if(property === undefined){\n continue;\n }else if(tagObj[property]){\n \n let val = compress(tagObj[property], options, newJpath);\n const isLeaf = isLeafTag(val, options);\n\n if(tagObj.attributes){\n assignAttributes( val, tagObj.attributes, newJpath, options);\n }else if(Object.keys(val).length === 1 && val[options.textNodeName] !== undefined && !options.alwaysCreateTextNode){\n val = val[options.textNodeName];\n }else if(Object.keys(val).length === 0){\n if(options.alwaysCreateTextNode) val[options.textNodeName] = \"\";\n else val = \"\";\n }\n\n if(compressedObj[property] !== undefined) {\n if(!Array.isArray(compressedObj[property])) {\n compressedObj[property] = [ compressedObj[property] ];\n }\n compressedObj[property].push(val);\n }else{\n //TODO: if a node is not an array, then check if it should be an array\n //also determine if it is a leaf node\n if (options.isArray(property, newJpath, isLeaf )) {\n compressedObj[property] = [val];\n }else{\n compressedObj[property] = val;\n }\n }\n }\n \n }\n // if(text && text.length > 0) compressedObj[options.textNodeName] = text;\n if(typeof text === \"string\"){\n if(text.length > 0) compressedObj[options.textNodeName] = text;\n }else if(text !== undefined) compressedObj[options.textNodeName] = text;\n return compressedObj;\n}\n\nfunction propName(obj){\n const keys = Object.keys(obj);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if(key !== \"attributes\") return key;\n }\n}\n\nfunction assignAttributes(obj, attrMap, jpath, options){\n if (attrMap) {\n const keys = Object.keys(attrMap);\n const len = keys.length; //don't make it inline\n for (let i = 0; i < len; i++) {\n const atrrName = keys[i];\n if (options.isArray(atrrName, jpath + \".\" + atrrName, true, true)) {\n obj[atrrName] = [ attrMap[atrrName] ];\n } else {\n obj[atrrName] = attrMap[atrrName];\n }\n }\n }\n}\n\nfunction isLeafTag(obj, options){\n const propCount = Object.keys(obj).length;\n if( propCount === 0 || (propCount === 1 && obj[options.textNodeName]) ) return true;\n return false;\n}\nexports.prettify = prettify;\n","'use strict';\n\nclass XmlNode{\n constructor(tagname) {\n this.tagname = tagname;\n this.child = []; //nested tags, text, cdata, comments in order\n this.attrsMap = {}; //attributes map\n }\n add(key,val){\n // this.child.push( {name : key, val: val, isCdata: isCdata });\n this.child.push( {[key]: val });\n }\n addChild(node) {\n if(node.attrsMap && Object.keys(node.attrsMap).length > 0){\n this.child.push( { [node.tagname]: node.child, attributes: node.attrsMap });\n }else{\n this.child.push( { [node.tagname]: node.child });\n }\n };\n};\n\n\nmodule.exports = XmlNode;"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://fxparser/webpack/bootstrap","webpack://fxparser/./node_modules/os-browserify/browser.js","webpack://fxparser/./node_modules/strnum/strnum.js","webpack://fxparser/./src/fxp.js","webpack://fxparser/./src/util.js","webpack://fxparser/./src/validator.js","webpack://fxparser/./src/xmlbuilder/json2xml.js","webpack://fxparser/./src/xmlbuilder/orderedJs2Xml.js","webpack://fxparser/./src/xmlparser/OptionsBuilder.js","webpack://fxparser/./src/xmlparser/OrderedObjParser.js","webpack://fxparser/./src/xmlparser/XMLParser.js","webpack://fxparser/./src/xmlparser/node2json.js","webpack://fxparser/./src/xmlparser/xmlNode.js"],"names":["exports","endianness","hostname","location","loadavg","uptime","freemem","Number","MAX_VALUE","totalmem","cpus","type","release","navigator","appVersion","networkInterfaces","getNetworkInterfaces","arch","platform","tmpdir","tmpDir","EOL","homedir","hexRegex","numRegex","consider","hex","leadingZeros","decimalPoint","toNumber","str","options","Object","assign","trimmedStr","trim","skipLike","undefined","test","parseInt","match","exec","negative","num","eNotation","length","module","validator","require","XMLParser","XMLBuilder","XMLValidator","nameStartChar","nameChar","nameRegexp","regexName","RegExp","getAllMatches","string","regex","matches","allmatches","startIndex","lastIndex","len","index","push","isName","isExist","v","isEmptyObject","obj","keys","merge","target","a","arrayMode","i","getValue","buildOptions","defaultOptions","props","newOptions","util","allowBooleanAttributes","unpairedTags","validate","xmlData","tags","tagFound","reachedRoot","substr","readPI","err","tagStartPos","readCommentAndCDATA","closingTag","tagName","substring","validateTagName","msg","getErrorObject","getLineNumberForPosition","result","readAttributeStr","attrStr","value","attrStrStart","isValid","validateAttributeString","code","line","tagClosed","otg","pop","openPos","col","indexOf","afterAmp","validateAmpersand","isWhiteSpace","JSON","stringify","map","t","replace","char","start","tagname","angleBracketsCount","doubleQuote","singleQuote","startChar","validAttrStrRegxp","attrNames","getPositionFromMatch","attrName","validateAttrName","hasOwnProperty","validateNumberAmpersand","re","count","message","lineNumber","lines","split","buildFromOrderedJs","attributeNamePrefix","attributesGroupName","textNodeName","ignoreAttributes","cdataPropName","format","indentBy","suppressEmptyNode","tagValueProcessor","key","attributeValueProcessor","preserveOrder","commentPropName","Builder","isAttribute","attrPrefixLen","processTextOrObjNode","indentate","tagEndChar","newLine","buildTextNode","buildEmptyTextNode","buildObjNode","buildEmptyObjNode","buildTextValNode","buildObjectNode","prototype","build","jObj","Array","isArray","arrayNodeName","j2x","val","level","Date","attr","arrLen","j","item","Ks","L","object","repeat","name","startsWith","toXml","jArray","arrToStr","arr","xmlStr","indentation","tagObj","propName","attStr","attr_to_str","attributes","tagStart","tagValue","attrMap","removeNSPrefix","parseTagValue","parseAttributeValue","trimValues","numberParseOptions","stopNodes","alwaysCreateTextNode","xmlNode","regx","window","parseFloat","parseValue","jPath","dontTrim","hasAttributes","isLeafNode","newval","_parseValue","trimmedVal","resolveNameSpace","prefix","charAt","shouldParse","attrsRegx","buildAttributesMap","attrs","oldVal","aName","newVal","attrCollection","parseToOrderedJsObj","xmlObj","currentNode","textData","tagsNodeStack","ch","closeIndex","findClosingIndex","colonIndex","child","add","isItStopNode","top","stopNode","lastIndexOf","endIndex","comment","tagExp","tagExpWithClosingIndex","data","separatorIndex","search","shouldBuildAttributesMap","childNode","addChild","currentTagName","matchingStopNodes","forEach","node","attrBoundary","errMsg","closingIndex","Error","prettify","parse","validationOption","toString","orderedResult","compress","text","compressedObj","property","newJpath","isLeaf","isLeafTag","assignAttributes","jpath","atrrName","propCount","XmlNode"],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;AClFAA,OAAO,CAACC,UAAR,GAAqB,YAAY;AAAE,SAAO,IAAP;AAAa,CAAhD;;AAEAD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CAAeA,OAAf,CACA,KAAKsH,KAAL,CAAa,EAAb,CAAiB;AACjB,KAAK3C,UAAL,CAAkB,EAAlB,CAAsB;AACvB,C,oCACD4C,G,CAAA,aAAI3F,GAAJ,CAAQwB,GAAR,CAAY,sBACV;AACA,KAAKkE,KAAL,CAAWpL,IAAX,uCAAmB0F,GAAnB,EAAyBwB,GAAzB,oBACD,C,QACDiF,Q,CAAA,kBAASI,IAAT,CAAe,CACb,GAAGA,IAAI,CAAC9D,UAAL,EAAmB3K,MAAM,CAACwC,IAAP,CAAYiM,IAAI,CAAC9D,UAAjB,EAA6B9J,MAA7B,CAAsC,CAA5D,CAA8D,uBAC5D,KAAKyM,KAAL,CAAWpL,IAAX,yCAAoBuM,IAAI,CAACzI,OAAzB,EAAmCyI,IAAI,CAACnB,KAAxC,mBAA+C3C,UAA/C,CAA2D8D,IAAI,CAAC9D,UAAhE,qBACD,CAFD,IAEK,uBACH,KAAK2C,KAAL,CAAWpL,IAAX,yCAAoBuM,IAAI,CAACzI,OAAzB,EAAmCyI,IAAI,CAACnB,KAAxC,qBACD,CACF,C,oBACF,CAGDxM,MAAM,CAAC9C,OAAP,CAAiB8R,OAAjB,C","file":"./lib/fxparser.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/fxp.js\");\n","exports.endianness = function () { return 'LE' };\n\nexports.hostname = function () {\n if (typeof location !== 'undefined') {\n return location.hostname\n }\n else return '';\n};\n\nexports.loadavg = function () { return [] };\n\nexports.uptime = function () { return 0 };\n\nexports.freemem = function () {\n return Number.MAX_VALUE;\n};\n\nexports.totalmem = function () {\n return Number.MAX_VALUE;\n};\n\nexports.cpus = function () { return [] };\n\nexports.type = function () { return 'Browser' };\n\nexports.release = function () {\n if (typeof navigator !== 'undefined') {\n return navigator.appVersion;\n }\n return '';\n};\n\nexports.networkInterfaces\n= exports.getNetworkInterfaces\n= function () { return {} };\n\nexports.arch = function () { return 'javascript' };\n\nexports.platform = function () { return 'browser' };\n\nexports.tmpdir = exports.tmpDir = function () {\n return '/tmp';\n};\n\nexports.EOL = '\\n';\n\nexports.homedir = function () {\n\treturn '/'\n};\n","const hexRegex = /^[-+]?0x[a-fA-F0-9]+$/;\nconst numRegex = /^([\\-\\+])?(0*)(\\.[0-9]+([eE]\\-?[0-9]+)?|[0-9]+(\\.[0-9]+([eE]\\-?[0-9]+)?)?)$/;\n// const octRegex = /0x[a-z0-9]+/;\n// const binRegex = /0x[a-z0-9]+/;\n\nconst consider = {\n hex : true,\n leadingZeros: true,\n decimalPoint: \"\\.\",\n //skipLike: /regex/\n};\n\nfunction toNumber(str, options = {}){\n // const options = Object.assign({}, consider);\n // if(opt.leadingZeros === false){\n // options.leadingZeros = false;\n // }else if(opt.hex === false){\n // options.hex = false;\n // }\n\n options = Object.assign({}, consider, options );\n if(!str || typeof str !== \"string\" ) return str;\n \n let trimmedStr = str.trim();\n \n if(options.skipLike !== undefined && options.skipLike.test(trimmedStr)) return str;\n else if (options.hex && hexRegex.test(trimmedStr)) {\n return Number.parseInt(trimmedStr, 16);\n // } else if (options.parseOct && octRegex.test(str)) {\n // return Number.parseInt(val, 8);\n // }else if (options.parseBin && binRegex.test(str)) {\n // return Number.parseInt(val, 2);\n }else{\n //separate negative sign, leading zeros, and rest number\n const match = numRegex.exec(trimmedStr);\n if(match){\n const negative = match[1];\n const leadingZeros = match[2];\n const num = match[3]; //complete num\n const eNotation = match[4] || match[6];\n if(leadingZeros.length === 1 && num[0] === \".\") return Number(str);\n else if(!options.leadingZeros && leadingZeros.length > 0) return str;\n else return Number(trimmedStr);\n }else{ //non-numeric string\n return str;\n }\n }\n}\n\nmodule.exports = toNumber\n","'use strict';\n\nconst validator = require('./validator');\nconst XMLParser = require('./xmlparser/XMLParser');\nconst XMLBuilder = require('./xmlbuilder/json2xml');\n\nmodule.exports = {\n XMLParser: XMLParser,\n XMLValidator: validator,\n XMLBuilder: XMLBuilder\n}","'use strict';\n\nconst nameStartChar = ':A-Za-z_\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD';\nconst nameChar = nameStartChar + '\\\\-.\\\\d\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040';\nconst nameRegexp = '[' + nameStartChar + '][' + nameChar + ']*'\nconst regexName = new RegExp('^' + nameRegexp + '$');\n\nconst getAllMatches = function(string, regex) {\n const matches = [];\n let match = regex.exec(string);\n while (match) {\n const allmatches = [];\n allmatches.startIndex = regex.lastIndex - match[0].length;\n const len = match.length;\n for (let index = 0; index < len; index++) {\n allmatches.push(match[index]);\n }\n matches.push(allmatches);\n match = regex.exec(string);\n }\n return matches;\n};\n\nconst isName = function(string) {\n const match = regexName.exec(string);\n return !(match === null || typeof match === 'undefined');\n};\n\nexports.isExist = function(v) {\n return typeof v !== 'undefined';\n};\n\nexports.isEmptyObject = function(obj) {\n return Object.keys(obj).length === 0;\n};\n\n/**\n * Copy all the properties of a into b.\n * @param {*} target\n * @param {*} a\n */\nexports.merge = function(target, a, arrayMode) {\n if (a) {\n const keys = Object.keys(a); // will return an array of own properties\n const len = keys.length; //don't make it inline\n for (let i = 0; i < len; i++) {\n if (arrayMode === 'strict') {\n target[keys[i]] = [ a[keys[i]] ];\n } else {\n target[keys[i]] = a[keys[i]];\n }\n }\n }\n};\n/* exports.merge =function (b,a){\n return Object.assign(b,a);\n} */\n\nexports.getValue = function(v) {\n if (exports.isExist(v)) {\n return v;\n } else {\n return '';\n }\n};\n\n// const fakeCall = function(a) {return a;};\n// const fakeCallNoReturn = function() {};\n\nconst buildOptions = function(options, defaultOptions, props) {\n let newOptions = {};\n if (!options) {\n return defaultOptions; //if there are not options\n }\n\n for (let i = 0; i < props.length; i++) {\n if (options[props[i]] !== undefined) {\n newOptions[props[i]] = options[props[i]];\n } else {\n newOptions[props[i]] = defaultOptions[props[i]];\n }\n }\n return newOptions;\n};\n\nexports.buildOptions = buildOptions;\nexports.isName = isName;\nexports.getAllMatches = getAllMatches;\nexports.nameRegexp = nameRegexp;\n","'use strict';\n\nconst util = require('./util');\n\nconst defaultOptions = {\n allowBooleanAttributes: false, //A tag can have attributes without any value\n unpairedTags: []\n};\n\nconst props = [\n 'allowBooleanAttributes',\n 'unpairedTags'\n];\n\n//const tagsPattern = new RegExp(\"<\\\\/?([\\\\w:\\\\-_\\.]+)\\\\s*\\/?>\",\"g\");\nexports.validate = function (xmlData, options) {\n options = util.buildOptions(options, defaultOptions, props);\n\n //xmlData = xmlData.replace(/(\\r\\n|\\n|\\r)/gm,\"\");//make it single line\n //xmlData = xmlData.replace(/(^\\s*<\\?xml.*?\\?>)/g,\"\");//Remove XML starting tag\n //xmlData = xmlData.replace(/()/g,\"\");//Remove DOCTYPE\n const tags = [];\n let tagFound = false;\n\n //indicates that the root tag has been closed (aka. depth 0 has been reached)\n let reachedRoot = false;\n\n if (xmlData[0] === '\\ufeff') {\n // check for byte order mark (BOM)\n xmlData = xmlData.substr(1);\n }\n \n for (let i = 0; i < xmlData.length; i++) {\n\n if (xmlData[i] === '<' && xmlData[i+1] === '?') {\n i+=2;\n i = readPI(xmlData,i);\n if (i.err) return i;\n }else if (xmlData[i] === '<') {\n //starting of tag\n //read until you reach to '>' avoiding any '>' in attribute value\n let tagStartPos = i;\n i++;\n \n if (xmlData[i] === '!') {\n i = readCommentAndCDATA(xmlData, i);\n continue;\n } else {\n let closingTag = false;\n if (xmlData[i] === '/') {\n //closing tag\n closingTag = true;\n i++;\n }\n //read tagname\n let tagName = '';\n for (; i < xmlData.length &&\n xmlData[i] !== '>' &&\n xmlData[i] !== ' ' &&\n xmlData[i] !== '\\t' &&\n xmlData[i] !== '\\n' &&\n xmlData[i] !== '\\r'; i++\n ) {\n tagName += xmlData[i];\n }\n tagName = tagName.trim();\n //console.log(tagName);\n\n if (tagName[tagName.length - 1] === '/') {\n //self closing tag without attributes\n tagName = tagName.substring(0, tagName.length - 1);\n //continue;\n i--;\n }\n if (!validateTagName(tagName)) {\n let msg;\n if (tagName.trim().length === 0) {\n msg = \"Invalid space after '<'.\";\n } else {\n msg = \"Tag '\"+tagName+\"' is an invalid name.\";\n }\n return getErrorObject('InvalidTag', msg, getLineNumberForPosition(xmlData, i));\n }\n\n const result = readAttributeStr(xmlData, i);\n if (result === false) {\n return getErrorObject('InvalidAttr', \"Attributes for '\"+tagName+\"' have open quote.\", getLineNumberForPosition(xmlData, i));\n }\n let attrStr = result.value;\n i = result.index;\n\n if (attrStr[attrStr.length - 1] === '/') {\n //self closing tag\n const attrStrStart = i - attrStr.length;\n attrStr = attrStr.substring(0, attrStr.length - 1);\n const isValid = validateAttributeString(attrStr, options);\n if (isValid === true) {\n tagFound = true;\n //continue; //text may presents after self closing tag\n } else {\n //the result from the nested function returns the position of the error within the attribute\n //in order to get the 'true' error line, we need to calculate the position where the attribute begins (i - attrStr.length) and then add the position within the attribute\n //this gives us the absolute index in the entire xml, which we can use to find the line at last\n return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line));\n }\n } else if (closingTag) {\n if (!result.tagClosed) {\n return getErrorObject('InvalidTag', \"Closing tag '\"+tagName+\"' doesn't have proper closing.\", getLineNumberForPosition(xmlData, i));\n } else if (attrStr.trim().length > 0) {\n return getErrorObject('InvalidTag', \"Closing tag '\"+tagName+\"' can't have attributes or invalid starting.\", getLineNumberForPosition(xmlData, tagStartPos));\n } else {\n const otg = tags.pop();\n if (tagName !== otg.tagName) {\n let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos);\n return getErrorObject('InvalidTag',\n \"Expected closing tag '\"+otg.tagName+\"' (opened in line \"+openPos.line+\", col \"+openPos.col+\") instead of closing tag '\"+tagName+\"'.\",\n getLineNumberForPosition(xmlData, tagStartPos));\n }\n\n //when there are no more tags, we reached the root level.\n if (tags.length == 0) {\n reachedRoot = true;\n }\n }\n } else {\n const isValid = validateAttributeString(attrStr, options);\n if (isValid !== true) {\n //the result from the nested function returns the position of the error within the attribute\n //in order to get the 'true' error line, we need to calculate the position where the attribute begins (i - attrStr.length) and then add the position within the attribute\n //this gives us the absolute index in the entire xml, which we can use to find the line at last\n return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line));\n }\n\n //if the root level has been reached before ...\n if (reachedRoot === true) {\n return getErrorObject('InvalidXml', 'Multiple possible root nodes found.', getLineNumberForPosition(xmlData, i));\n } else if(options.unpairedTags.indexOf(tagName) !== -1){\n //don't push into stack\n } else {\n tags.push({tagName, tagStartPos});\n }\n tagFound = true;\n }\n\n //skip tag text value\n //It may include comments and CDATA value\n for (i++; i < xmlData.length; i++) {\n if (xmlData[i] === '<') {\n if (xmlData[i + 1] === '!') {\n //comment or CADATA\n i++;\n i = readCommentAndCDATA(xmlData, i);\n continue;\n } else if (xmlData[i+1] === '?') {\n i = readPI(xmlData, ++i);\n if (i.err) return i;\n } else{\n break;\n }\n } else if (xmlData[i] === '&') {\n const afterAmp = validateAmpersand(xmlData, i);\n if (afterAmp == -1)\n return getErrorObject('InvalidChar', \"char '&' is not expected.\", getLineNumberForPosition(xmlData, i));\n i = afterAmp;\n }else{\n if (reachedRoot === true && !isWhiteSpace(xmlData[i])) {\n return getErrorObject('InvalidXml', \"Extra text at the end\", getLineNumberForPosition(xmlData, i));\n }\n }\n } //end of reading tag text value\n if (xmlData[i] === '<') {\n i--;\n }\n }\n } else {\n if ( isWhiteSpace(xmlData[i])) {\n continue;\n }\n return getErrorObject('InvalidChar', \"char '\"+xmlData[i]+\"' is not expected.\", getLineNumberForPosition(xmlData, i));\n }\n }\n\n if (!tagFound) {\n return getErrorObject('InvalidXml', 'Start tag expected.', 1);\n }else if (tags.length == 1) {\n return getErrorObject('InvalidTag', \"Unclosed tag '\"+tags[0].tagName+\"'.\", getLineNumberForPosition(xmlData, tags[0].tagStartPos));\n }else if (tags.length > 0) {\n return getErrorObject('InvalidXml', \"Invalid '\"+\n JSON.stringify(tags.map(t => t.tagName), null, 4).replace(/\\r?\\n/g, '')+\n \"' found.\", {line: 1, col: 1});\n }\n\n return true;\n};\n\nfunction isWhiteSpace(char){\n return char === ' ' || char === '\\t' || char === '\\n' || char === '\\r';\n}\n/**\n * Read Processing insstructions and skip\n * @param {*} xmlData\n * @param {*} i\n */\nfunction readPI(xmlData, i) {\n const start = i;\n for (; i < xmlData.length; i++) {\n if (xmlData[i] == '?' || xmlData[i] == ' ') {\n //tagname\n const tagname = xmlData.substr(start, i - start);\n if (i > 5 && tagname === 'xml') {\n return getErrorObject('InvalidXml', 'XML declaration allowed only at the start of the document.', getLineNumberForPosition(xmlData, i));\n } else if (xmlData[i] == '?' && xmlData[i + 1] == '>') {\n //check if valid attribut string\n i++;\n break;\n } else {\n continue;\n }\n }\n }\n return i;\n}\n\nfunction readCommentAndCDATA(xmlData, i) {\n if (xmlData.length > i + 5 && xmlData[i + 1] === '-' && xmlData[i + 2] === '-') {\n //comment\n for (i += 3; i < xmlData.length; i++) {\n if (xmlData[i] === '-' && xmlData[i + 1] === '-' && xmlData[i + 2] === '>') {\n i += 2;\n break;\n }\n }\n } else if (\n xmlData.length > i + 8 &&\n xmlData[i + 1] === 'D' &&\n xmlData[i + 2] === 'O' &&\n xmlData[i + 3] === 'C' &&\n xmlData[i + 4] === 'T' &&\n xmlData[i + 5] === 'Y' &&\n xmlData[i + 6] === 'P' &&\n xmlData[i + 7] === 'E'\n ) {\n let angleBracketsCount = 1;\n for (i += 8; i < xmlData.length; i++) {\n if (xmlData[i] === '<') {\n angleBracketsCount++;\n } else if (xmlData[i] === '>') {\n angleBracketsCount--;\n if (angleBracketsCount === 0) {\n break;\n }\n }\n }\n } else if (\n xmlData.length > i + 9 &&\n xmlData[i + 1] === '[' &&\n xmlData[i + 2] === 'C' &&\n xmlData[i + 3] === 'D' &&\n xmlData[i + 4] === 'A' &&\n xmlData[i + 5] === 'T' &&\n xmlData[i + 6] === 'A' &&\n xmlData[i + 7] === '['\n ) {\n for (i += 8; i < xmlData.length; i++) {\n if (xmlData[i] === ']' && xmlData[i + 1] === ']' && xmlData[i + 2] === '>') {\n i += 2;\n break;\n }\n }\n }\n\n return i;\n}\n\nconst doubleQuote = '\"';\nconst singleQuote = \"'\";\n\n/**\n * Keep reading xmlData until '<' is found outside the attribute value.\n * @param {string} xmlData\n * @param {number} i\n */\nfunction readAttributeStr(xmlData, i) {\n let attrStr = '';\n let startChar = '';\n let tagClosed = false;\n for (; i < xmlData.length; i++) {\n if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) {\n if (startChar === '') {\n startChar = xmlData[i];\n } else if (startChar !== xmlData[i]) {\n //if vaue is enclosed with double quote then single quotes are allowed inside the value and vice versa\n } else {\n startChar = '';\n }\n } else if (xmlData[i] === '>') {\n if (startChar === '') {\n tagClosed = true;\n break;\n }\n }\n attrStr += xmlData[i];\n }\n if (startChar !== '') {\n return false;\n }\n\n return {\n value: attrStr,\n index: i,\n tagClosed: tagClosed\n };\n}\n\n/**\n * Select all the attributes whether valid or invalid.\n */\nconst validAttrStrRegxp = new RegExp('(\\\\s*)([^\\\\s=]+)(\\\\s*=)?(\\\\s*([\\'\"])(([\\\\s\\\\S])*?)\\\\5)?', 'g');\n\n//attr, =\"sd\", a=\"amit's\", a=\"sd\"b=\"saf\", ab cd=\"\"\n\nfunction validateAttributeString(attrStr, options) {\n //console.log(\"start:\"+attrStr+\":end\");\n\n //if(attrStr.trim().length === 0) return true; //empty string\n\n const matches = util.getAllMatches(attrStr, validAttrStrRegxp);\n const attrNames = {};\n\n for (let i = 0; i < matches.length; i++) {\n if (matches[i][1].length === 0) {\n //nospace before attribute name: a=\"sd\"b=\"saf\"\n return getErrorObject('InvalidAttr', \"Attribute '\"+matches[i][2]+\"' has no space in starting.\", getPositionFromMatch(matches[i]))\n } else if (matches[i][3] === undefined && !options.allowBooleanAttributes) {\n //independent attribute: ab\n return getErrorObject('InvalidAttr', \"boolean attribute '\"+matches[i][2]+\"' is not allowed.\", getPositionFromMatch(matches[i]));\n }\n /* else if(matches[i][6] === undefined){//attribute without value: ab=\n return { err: { code:\"InvalidAttr\",msg:\"attribute \" + matches[i][2] + \" has no value assigned.\"}};\n } */\n const attrName = matches[i][2];\n if (!validateAttrName(attrName)) {\n return getErrorObject('InvalidAttr', \"Attribute '\"+attrName+\"' is an invalid name.\", getPositionFromMatch(matches[i]));\n }\n if (!attrNames.hasOwnProperty(attrName)) {\n //check for duplicate attribute.\n attrNames[attrName] = 1;\n } else {\n return getErrorObject('InvalidAttr', \"Attribute '\"+attrName+\"' is repeated.\", getPositionFromMatch(matches[i]));\n }\n }\n\n return true;\n}\n\nfunction validateNumberAmpersand(xmlData, i) {\n let re = /\\d/;\n if (xmlData[i] === 'x') {\n i++;\n re = /[\\da-fA-F]/;\n }\n for (; i < xmlData.length; i++) {\n if (xmlData[i] === ';')\n return i;\n if (!xmlData[i].match(re))\n break;\n }\n return -1;\n}\n\nfunction validateAmpersand(xmlData, i) {\n // https://www.w3.org/TR/xml/#dt-charref\n i++;\n if (xmlData[i] === ';')\n return -1;\n if (xmlData[i] === '#') {\n i++;\n return validateNumberAmpersand(xmlData, i);\n }\n let count = 0;\n for (; i < xmlData.length; i++, count++) {\n if (xmlData[i].match(/\\w/) && count < 20)\n continue;\n if (xmlData[i] === ';')\n break;\n return -1;\n }\n return i;\n}\n\nfunction getErrorObject(code, message, lineNumber) {\n return {\n err: {\n code: code,\n msg: message,\n line: lineNumber.line || lineNumber,\n col: lineNumber.col,\n },\n };\n}\n\nfunction validateAttrName(attrName) {\n return util.isName(attrName);\n}\n\n// const startsWithXML = /^xml/i;\n\nfunction validateTagName(tagname) {\n return util.isName(tagname) /* && !tagname.match(startsWithXML) */;\n}\n\n//this function returns the line number for the character at the given index\nfunction getLineNumberForPosition(xmlData, index) {\n const lines = xmlData.substring(0, index).split(/\\r?\\n/);\n return {\n line: lines.length,\n\n // column number is last line's length + 1, because column numbering starts at 1:\n col: lines[lines.length - 1].length + 1\n };\n}\n\n//this function returns the position of the first character of match within attrStr\nfunction getPositionFromMatch(match) {\n return match.startIndex + match[1].length;\n}\n","'use strict';\n//parse Empty Node as self closing node\nconst buildOptions = require('../util').buildOptions;\nconst buildFromOrderedJs = require('./orderedJs2Xml');\n\nconst defaultOptions = {\n attributeNamePrefix: '@_',\n attributesGroupName: false,\n textNodeName: '#text',\n ignoreAttributes: true,\n cdataPropName: false,\n format: false,\n indentBy: ' ',\n suppressEmptyNode: false,\n tagValueProcessor: function(key, a) {\n return a;\n },\n attributeValueProcessor: function(attrName, a) {\n return a;\n },\n preserveOrder: false,\n commentPropName: false,\n unpairedTags: [],\n};\n\nconst props = [\n 'attributeNamePrefix',\n 'attributesGroupName',\n 'textNodeName',\n 'ignoreAttributes',\n 'cdataPropName',\n 'format',\n 'indentBy',\n 'suppressEmptyNode',\n 'tagValueProcessor',\n 'attributeValueProcessor',\n 'arrayNodeName', //when array as root\n 'preserveOrder',\n \"commentPropName\",\n \"unpairedTags\",\n // 'rootNodeName', //when jsObject have multiple properties on root level\n];\n\nfunction Builder(options) {\n this.options = buildOptions(options, defaultOptions, props);\n if (this.options.ignoreAttributes || this.options.attributesGroupName) {\n this.isAttribute = function(/*a*/) {\n return false;\n };\n } else {\n this.attrPrefixLen = this.options.attributeNamePrefix.length;\n this.isAttribute = isAttribute;\n }\n\n this.processTextOrObjNode = processTextOrObjNode\n\n if (this.options.format) {\n this.indentate = indentate;\n this.tagEndChar = '>\\n';\n this.newLine = '\\n';\n } else {\n this.indentate = function() {\n return '';\n };\n this.tagEndChar = '>';\n this.newLine = '';\n }\n\n if (this.options.suppressEmptyNode) {\n this.buildTextNode = buildEmptyTextNode;\n this.buildObjNode = buildEmptyObjNode;\n } else {\n this.buildTextNode = buildTextValNode;\n this.buildObjNode = buildObjectNode;\n }\n\n this.buildTextValNode = buildTextValNode;\n this.buildObjectNode = buildObjectNode;\n}\n\nBuilder.prototype.build = function(jObj) {\n if(this.options.preserveOrder){\n return buildFromOrderedJs(jObj, this.options);\n }else {\n if(Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1){\n jObj = {\n [this.options.arrayNodeName] : jObj\n }\n }\n return this.j2x(jObj, 0).val;\n }\n};\n\nBuilder.prototype.j2x = function(jObj, level) {\n let attrStr = '';\n let val = '';\n for (let key in jObj) {\n if (typeof jObj[key] === 'undefined') {\n // supress undefined node\n } else if (jObj[key] === null) {\n val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;\n } else if (jObj[key] instanceof Date) {\n val += this.buildTextNode(jObj[key], key, '', level);\n } else if (typeof jObj[key] !== 'object') {\n //premitive type\n const attr = this.isAttribute(key);\n if (attr) {\n attrStr += ' ' + attr + '=\"' + this.options.attributeValueProcessor(attr, '' + jObj[key]) + '\"';\n }else {\n //tag value\n if (key === this.options.textNodeName) {\n val += this.options.tagValueProcessor(key, '' + jObj[key]);\n } else {\n val += this.buildTextNode(jObj[key], key, '', level);\n }\n }\n } else if (Array.isArray(jObj[key])) {\n //repeated nodes\n const arrLen = jObj[key].length;\n for (let j = 0; j < arrLen; j++) {\n const item = jObj[key][j];\n if (typeof item === 'undefined') {\n // supress undefined node\n } else if (item === null) {\n val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;\n } else if (typeof item === 'object') {\n val += this.processTextOrObjNode(item, key, level)\n } else {\n val += this.buildTextNode(item, key, '', level);\n }\n }\n } else {\n //nested node\n if (this.options.attributesGroupName && key === this.options.attributesGroupName) {\n const Ks = Object.keys(jObj[key]);\n const L = Ks.length;\n for (let j = 0; j < L; j++) {\n attrStr += ' ' + Ks[j] + '=\"' + this.options.attributeValueProcessor(Ks[j], '' + jObj[key][Ks[j]]) + '\"';\n }\n } else {\n val += this.processTextOrObjNode(jObj[key], key, level)\n }\n }\n }\n return {attrStr: attrStr, val: val};\n};\n\nfunction processTextOrObjNode (object, key, level) {\n const result = this.j2x(object, level + 1);\n if (object[this.options.textNodeName] !== undefined && Object.keys(object).length === 1) {\n return this.buildTextNode(result.val, key, result.attrStr, level);\n } else {\n return this.buildObjNode(result.val, key, result.attrStr, level);\n }\n}\n\nfunction buildObjectNode(val, key, attrStr, level) {\n if (attrStr && val.indexOf('<') === -1) {\n return (\n this.indentate(level) +\n '<' +\n key +\n attrStr +\n '>' +\n val +\n //+ this.newLine\n // + this.indentate(level)\n '' +\n this.options.tagValueProcessor(key, val) +\n ' 0){//TODO: this logic can be avoided for each call\n indentation = EOL + \"\" + options.indentBy.repeat(level);\n }\n\n for (let i = 0; i < arr.length; i++) {\n const tagObj = arr[i];\n const tagName = propName(tagObj);\n\n if(tagName === options.textNodeName){\n xmlStr += indentation + options.tagValueProcessor( tagName, tagObj[tagName]);\n continue;\n }else if( tagName === options.cdataPropName){\n xmlStr += indentation + ``;\n continue;\n }else if( tagName === options.commentPropName){\n xmlStr += indentation + ``;\n continue;\n }\n const attStr = attr_to_str(tagObj.attributes, options);\n let tagStart = indentation + `<${tagName}${attStr}`;\n let tagValue = arrToStr(tagObj[tagName], options, level + 1);\n if( (!tagValue || tagValue.length === 0) && options.suppressEmptyNode){ \n if(options.unpairedTags.indexOf(tagName) !== -1){\n xmlStr += tagStart + \">\"; \n }else{\n xmlStr += tagStart + \"/>\"; \n }\n }else{ \n //TODO: node with only text value should not parse the text value in next line\n xmlStr += tagStart + `>${tagValue}${indentation}` ;\n }\n }\n \n return xmlStr;\n}\n\nfunction propName(obj){\n const keys = Object.keys(obj);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if(key !== \"attributes\") return key;\n }\n }\n\nfunction attr_to_str(attrMap, options){\n let attrStr = \"\";\n if(attrMap && !options.ignoreAttributes){\n for( attr in attrMap){\n attrStr+= ` ${attr.substr(options.attributeNamePrefix.length)}=\"${options.attributeValueProcessor(attr, attrMap[attr])}\"`;\n }\n }\n return attrStr;\n}\n\nmodule.exports = toXml;","\nconst defaultOptions = {\n preserveOrder: false,\n attributeNamePrefix: '@_',\n attributesGroupName: false,\n textNodeName: '#text',\n ignoreAttributes: true,\n removeNSPrefix: false, // remove NS from tag name or attribute name if true\n allowBooleanAttributes: false, //a tag can have attributes without any value\n //ignoreRootElement : false,\n parseTagValue: true,\n parseAttributeValue: false,\n trimValues: true, //Trim string values of tag and attributes\n cdataPropName: false,\n numberParseOptions: {\n hex: true,\n leadingZeros: true\n },\n tagValueProcessor: function(tagName, val) {\n return val;\n },\n attributeValueProcessor: function(attrName, val) {\n return val;\n },\n stopNodes: [], //nested tags will not be parsed even for errors\n alwaysCreateTextNode: false,\n isArray: () => false,\n commentPropName: false,\n unpairedTags: [],\n};\n \nconst props = [\n 'preserveOrder',\n 'attributeNamePrefix',\n 'attributesGroupName',\n 'textNodeName',\n 'ignoreAttributes',\n 'removeNSPrefix',\n 'allowBooleanAttributes',\n 'parseTagValue',\n 'parseAttributeValue',\n 'trimValues',\n 'cdataPropName',\n 'tagValueProcessor',\n 'attributeValueProcessor',\n 'numberParseOptions',\n 'stopNodes',\n 'alwaysCreateTextNode',\n 'isArray',\n 'commentPropName',\n 'unpairedTags',\n];\n \nconst util = require('../util');\n\nconst buildOptions = function(options) {\n return util.buildOptions(options, defaultOptions, props);\n};\n\nexports.buildOptions = buildOptions;\nexports.defaultOptions = defaultOptions;\nexports.props = props;","'use strict';\n\nconst util = require('../util');\nconst xmlNode = require('./xmlNode');\nconst toNumber = require(\"strnum\");\n\nconst regx =\n '<((!\\\\[CDATA\\\\[([\\\\s\\\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\\\/)(NAME)\\\\s*>))([^<]*)'\n .replace(/NAME/g, util.nameRegexp);\n\n//const tagsRegx = new RegExp(\"<(\\\\/?[\\\\w:\\\\-\\._]+)([^>]*)>(\\\\s*\"+cdataRegx+\")*([^<]+)?\",\"g\");\n//const tagsRegx = new RegExp(\"<(\\\\/?)((\\\\w*:)?([\\\\w:\\\\-\\._]+))([^>]*)>([^<]*)(\"+cdataRegx+\"([^<]*))*([^<]+)?\",\"g\");\n\n//polyfill\nif (!Number.parseInt && window.parseInt) {\n Number.parseInt = window.parseInt;\n}\nif (!Number.parseFloat && window.parseFloat) {\n Number.parseFloat = window.parseFloat;\n}\n\n\n/**\n * @param {string} val\n * @param {object} options\n * @param {string} tagName\n * @param {string} jPath\n * @param {boolean} dontTrim\n * @param {boolean} hasAttributes\n * @param {boolean} isLeafNode\n */\nfunction parseValue(val, options, tagName, jPath, dontTrim, hasAttributes, isLeafNode) {\n if (val !== undefined) {\n if (options.trimValues && !dontTrim) {\n val = val.trim();\n }\n if(val.length > 0){\n const newval = options.tagValueProcessor(tagName, val, jPath, hasAttributes, isLeafNode);\n if(newval === null || newval === undefined){\n //don't parse\n return val;\n }else if(typeof newval !== typeof val || newval !== val){\n //overwrite\n return newval;\n }else if(options.trimValues){\n return _parseValue(val, options.parseTagValue, options.numberParseOptions);\n }else{\n const trimmedVal = val.trim();\n if(trimmedVal === val){\n return _parseValue(val, options.parseTagValue, options.numberParseOptions);\n }else{\n return val;\n }\n }\n }\n }\n}\n\nfunction resolveNameSpace(tagname, options) {\n if (options.removeNSPrefix) {\n const tags = tagname.split(':');\n const prefix = tagname.charAt(0) === '/' ? '/' : '';\n if (tags[0] === 'xmlns') {\n return '';\n }\n if (tags.length === 2) {\n tagname = prefix + tags[1];\n }\n }\n return tagname;\n}\n\nfunction _parseValue(val, shouldParse, options) {\n if (shouldParse && typeof val === 'string') {\n //console.log(options)\n const newval = val.trim();\n if(newval === 'true' ) return true;\n else if(newval === 'false' ) return false;\n else return toNumber(val, options);\n } else {\n if (util.isExist(val)) {\n return val;\n } else {\n return '';\n }\n }\n}\n\n//TODO: change regex to capture NS\n//const attrsRegx = new RegExp(\"([\\\\w\\\\-\\\\.\\\\:]+)\\\\s*=\\\\s*(['\\\"])((.|\\n)*?)\\\\2\",\"gm\");\nconst attrsRegx = new RegExp('([^\\\\s=]+)\\\\s*(=\\\\s*([\\'\"])([\\\\s\\\\S]*?)\\\\3)?', 'gm');\n\nfunction buildAttributesMap(attrStr, jPath, options) {\n if (!options.ignoreAttributes && typeof attrStr === 'string') {\n // attrStr = attrStr.replace(/\\r?\\n/g, ' ');\n //attrStr = attrStr || attrStr.trim();\n\n const matches = util.getAllMatches(attrStr, attrsRegx);\n const len = matches.length; //don't make it inline\n const attrs = {};\n for (let i = 0; i < len; i++) {\n const attrName = resolveNameSpace(matches[i][1], options);\n let oldVal = matches[i][4];\n const aName = options.attributeNamePrefix + attrName;\n if (attrName.length) {\n if (oldVal !== undefined) {\n if (options.trimValues) {\n oldVal = oldVal.trim();\n }\n \n const newVal = options.attributeValueProcessor(attrName, oldVal, jPath);\n if(newVal === null || newVal === undefined){\n //don't parse\n attrs[aName] = oldVal;\n }else if(typeof newVal !== typeof oldVal || newVal !== oldVal){\n //overwrite\n attrs[aName] = newVal;\n }else{\n //parse\n attrs[aName] = _parseValue(\n oldVal,\n options.parseAttributeValue,\n options.numberParseOptions\n );\n }\n } else if (options.allowBooleanAttributes) {\n attrs[aName] = true;\n }\n }\n }\n if (!Object.keys(attrs).length) {\n return;\n }\n if (options.attributesGroupName) {\n const attrCollection = {};\n attrCollection[options.attributesGroupName] = attrs;\n return attrCollection;\n }\n return attrs;\n }\n}\n\nconst parseToOrderedJsObj = function(xmlData, options) {\n xmlData = xmlData.replace(/\\r\\n?/g, \"\\n\"); //TODO: remove this line\n const xmlObj = new xmlNode('!xml');\n let currentNode = xmlObj;\n let textData = \"\";\n const tagsNodeStack = [];\n let jPath = \"\";\n\n for(let i=0; i< xmlData.length; i++){//for each char in XML data\n const ch = xmlData[i];\n if(ch === '<'){\n // const nextIndex = i+1;\n // const _2ndChar = xmlData[nextIndex];\n if( xmlData[i+1] === '/') {//Closing Tag\n const closeIndex = findClosingIndex(xmlData, \">\", i, \"Closing Tag is not closed.\")\n let tagName = xmlData.substring(i+2,closeIndex).trim();\n\n if(options.removeNSPrefix){\n const colonIndex = tagName.indexOf(\":\");\n if(colonIndex !== -1){\n tagName = tagName.substr(colonIndex+1);\n }\n }\n \n if(currentNode){\n textData = parseValue(textData\n , options\n , currentNode.tagname\n , jPath\n ,false\n , currentNode.attributes ? Object.keys(currentNode.attributes).length !== 0 : false\n , Object.keys(currentNode.child).length === 0);\n if(textData !== undefined && textData !== \"\") currentNode.add(options.textNodeName, textData);\n textData = \"\";\n }\n\n if (isItStopNode(options.stopNodes, tagsNodeStack, currentNode.tagname)) { //TODO: namespace\n const top = tagsNodeStack[tagsNodeStack.length - 1];\n const stopNode = top.child[ top.child.length -1 ];\n stopNode[currentNode.tagname] = [ { [options.textNodeName] :xmlData.substr(currentNode.startIndex + 1, i - currentNode.startIndex - 1) }];\n }\n \n jPath = jPath.substr(0, jPath.lastIndexOf(\".\"));\n \n currentNode = tagsNodeStack.pop();//avoid recurssion, set the parent tag scope\n textData = \"\";\n i = closeIndex;\n } else if( xmlData[i+1] === '?') {\n i = findClosingIndex(xmlData, \"?>\", i, \"Pi Tag is not closed.\")\n } else if(xmlData.substr(i + 1, 3) === '!--') {\n const endIndex = findClosingIndex(xmlData, \"-->\", i, \"Comment is not closed.\")\n if(options.commentPropName){\n const comment = xmlData.substring(i + 4, endIndex - 2);\n\n //TODO: remove repeated code\n if(textData){ //store previously collected data as textNode\n textData = parseValue(textData\n , options\n , currentNode.tagname\n , jPath\n ,false\n , currentNode.attributes ? Object.keys(currentNode.attributes).length !== 0 : false\n , Object.keys(currentNode.child).length === 0);\n \n if(textData !== undefined && textData !== \"\") currentNode.add(options.textNodeName, textData);\n textData = \"\";\n }\n currentNode.add(options.commentPropName, [ { [options.textNodeName] : comment } ]);\n }\n i = endIndex;\n } else if( xmlData.substr(i + 1, 2) === '!D') {\n const closeIndex = findClosingIndex(xmlData, \">\", i, \"DOCTYPE is not closed.\")\n const tagExp = xmlData.substring(i, closeIndex);\n if(tagExp.indexOf(\"[\") >= 0){\n i = xmlData.indexOf(\"]>\", i) + 1;\n }else{\n i = closeIndex;\n }\n }else if(xmlData.substr(i + 1, 2) === '![') {\n const closeIndex = findClosingIndex(xmlData, \"]]>\", i, \"CDATA is not closed.\") - 2;\n const tagExp = xmlData.substring(i + 9,closeIndex);\n\n if(textData){ //store previously collected data as textNode\n textData = parseValue(textData\n , options\n , currentNode.tagname\n , jPath\n ,false\n , currentNode.attributes ? Object.keys(currentNode.attributes).length !== 0 : false\n , Object.keys(currentNode.child).length === 0);\n\n if(textData !== undefined && textData !== \"\") currentNode.add(options.textNodeName, textData);\n textData = \"\";\n }\n\n //cdata should be set even if it is 0 length string\n if(options.cdataPropName){\n let val = parseValue(tagExp, options, options.cdataPropName, jPath + \".\" + options.cdataPropName, true, false, true);\n if(!val) val = \"\";\n currentNode.add(options.cdataPropName, [ { [options.textNodeName] : val } ]);\n }else{\n let val = parseValue(tagExp, options, currentNode.tagname, jPath, true, false, true);\n if(!val) val = \"\";\n currentNode.add(options.textNodeName, val);\n }\n \n i = closeIndex + 2;\n }else {//Opening tag\n const result = tagExpWithClosingIndex(xmlData, i+1)\n let tagExp = result.data;\n const closeIndex = result.index;\n const separatorIndex = tagExp.search(/\\s/);\n let tagName = tagExp;\n let shouldBuildAttributesMap = true;\n if(separatorIndex !== -1){//separate tag name and attributes expression\n tagName = tagExp.substr(0, separatorIndex).replace(/\\s\\s*$/, '');\n tagExp = tagExp.substr(separatorIndex + 1);\n }\n\n if(options.removeNSPrefix){\n const colonIndex = tagName.indexOf(\":\");\n if(colonIndex !== -1){\n tagName = tagName.substr(colonIndex+1);\n shouldBuildAttributesMap = tagName !== result.data.substr(colonIndex + 1);\n }\n }\n \n //save text as child node\n if (currentNode && textData) {\n if(currentNode.tagname !== '!xml'){\n //when nested tag is found\n textData = parseValue(textData\n , options\n , currentNode.tagname\n , jPath\n , false\n , currentNode.attributes ? Object.keys(currentNode.attributes).length !== 0 : false\n , false);\n if(textData !== undefined && textData !== \"\") currentNode.add(options.textNodeName, textData);\n textData = \"\";\n }\n }\n\n if(tagName !== xmlObj.tagname){\n jPath += jPath ? \".\" + tagName : tagName;\n }\n\n //selfClosing tag\n if(tagExp.length > 0 && tagExp.lastIndexOf(\"/\") === tagExp.length - 1){\n \n if(tagName[tagName.length - 1] === \"/\"){ //remove trailing '/'\n tagName = tagName.substr(0, tagName.length - 1);\n tagExp = tagName;\n }else{\n tagExp = tagExp.substr(0, tagExp.length - 1);\n }\n\n const childNode = new xmlNode(tagName);\n if(tagName !== tagExp && shouldBuildAttributesMap){\n childNode.attributes = buildAttributesMap(tagExp, jPath , options);\n }\n jPath = jPath.substr(0, jPath.lastIndexOf(\".\"));\n // tagsNodeStack.push(currentNode);\n currentNode.addChild(childNode);\n }\n //boolean tags\n else if(options.unpairedTags.indexOf(tagName) !== -1){\n // tagExp = tagExp.substr(0, tagExp.length - 1);\n\n const childNode = new xmlNode(tagName);\n if(tagName !== tagExp && shouldBuildAttributesMap){\n childNode.attributes = buildAttributesMap(tagExp, jPath , options);\n }\n jPath = jPath.substr(0, jPath.lastIndexOf(\".\"));\n // tagsNodeStack.push(currentNode);\n currentNode.addChild(childNode);\n }\n //opening tag\n else{\n \n const childNode = new xmlNode( tagName);\n tagsNodeStack.push(currentNode);\n \n childNode.startIndex=closeIndex; //for further processing\n \n if(tagName !== tagExp && shouldBuildAttributesMap){\n childNode.attributes = buildAttributesMap(tagExp, jPath, options);\n }\n currentNode.addChild(childNode);\n currentNode = childNode;\n }\n textData = \"\";\n i = closeIndex;\n }\n }else{\n textData += xmlData[i];\n }\n }\n return xmlObj.child;\n}\n\n//TODO: use jPath to simplify the logic\n/**\n * \n * @param {string[]} stopNodes \n * @param {XmlNode[]} tagsNodeStack \n */\nfunction isItStopNode(stopNodes, tagsNodeStack, currentTagName){\n const matchingStopNodes = [];\n //filter the list of stopNodes as per current tag\n stopNodes.forEach( jPath => {\n if( jPath.substr( jPath.length - currentTagName.length) === currentTagName) matchingStopNodes.push(jPath);\n });\n\n if(matchingStopNodes.length > 0){\n let jPath = \"\";\n for (let i = 1; i < tagsNodeStack.length; i++) {\n const node = tagsNodeStack[i];\n jPath += \".\" + node.tagname;\n }\n jPath += \".\" + currentTagName;\n jPath = jPath.substr(1);\n for (let i = 0; i < matchingStopNodes.length; i++) {\n if(matchingStopNodes[i] === jPath) return true;\n }\n }else return false;\n}\n\n/**\n * Returns the tag Expression and where it is ending handling single-dobule quotes situation\n * @param {string} xmlData \n * @param {number} i starting index\n * @returns \n */\nfunction tagExpWithClosingIndex(xmlData, i){\n let attrBoundary;\n let tagExp = \"\";\n for (let index = i; index < xmlData.length; index++) {\n let ch = xmlData[index];\n if (attrBoundary) {\n if (ch === attrBoundary) attrBoundary = \"\";//reset\n } else if (ch === '\"' || ch === \"'\") {\n attrBoundary = ch;\n } else if (ch === '>') {\n return {\n data: tagExp,\n index: index\n }\n } else if (ch === '\\t') {\n ch = \" \"\n }\n tagExp += ch;\n }\n}\n\nfunction findClosingIndex(xmlData, str, i, errMsg){\n const closingIndex = xmlData.indexOf(str, i);\n if(closingIndex === -1){\n throw new Error(errMsg)\n }else{\n return closingIndex + str.length - 1;\n }\n}\n\nexports.parseToOrderedJsObj = parseToOrderedJsObj;\n","const { buildOptions} = require(\"./OptionsBuilder\");\nconst { parseToOrderedJsObj} = require(\"./OrderedObjParser\");\nconst { prettify} = require(\"./node2json\");\nconst validator = require('../validator');\n\nclass XMLParser{\n constructor(options){\n this.options = buildOptions(options);\n }\n /**\n * Parse XML dats to JS object \n * @param {string|Buffer} xmlData \n * @param {boolean|Object} validationOption \n */\n parse(xmlData,validationOption){\n if(typeof xmlData === \"string\"){\n }else if( xmlData.toString){\n xmlData = xmlData.toString();\n }else{\n throw new Error(\"XML data is accepted in String or Bytes[] form.\")\n }\n if( validationOption){\n if(validationOption === true) validationOption = {}; //validate with default options\n \n const result = validator.validate(xmlData, validationOption);\n if (result !== true) {\n throw Error( `${result.err.msg}:${result.err.line}:${result.err.col}` )\n }\n }\n const orderedResult = parseToOrderedJsObj(xmlData, this.options);\n if(this.options.preserveOrder || orderedResult === undefined) return orderedResult;\n else return prettify(orderedResult, this.options);\n }\n}\n\nmodule.exports = XMLParser;","'use strict';\n\n/**\n * \n * @param {array} node \n * @param {any} options \n * @returns \n */\nfunction prettify(node, options){\n return compress( node, options);\n}\n\n/**\n * \n * @param {array} arr \n * @param {object} options \n * @param {string} jPath \n * @returns object\n */\nfunction compress(arr, options, jPath){\n let text;\n const compressedObj = {};\n for (let i = 0; i < arr.length; i++) {\n const tagObj = arr[i];\n const property = propName(tagObj);\n let newJpath = \"\";\n if(jPath === undefined) newJpath = property;\n else newJpath = jPath + \".\" + property;\n\n if(property === options.textNodeName){\n if(text === undefined) text = tagObj[property];\n else text += \"\" + tagObj[property];\n }else if(property === undefined){\n continue;\n }else if(tagObj[property]){\n \n let val = compress(tagObj[property], options, newJpath);\n const isLeaf = isLeafTag(val, options);\n\n if(tagObj.attributes){\n assignAttributes( val, tagObj.attributes, newJpath, options);\n }else if(Object.keys(val).length === 1 && val[options.textNodeName] !== undefined && !options.alwaysCreateTextNode){\n val = val[options.textNodeName];\n }else if(Object.keys(val).length === 0){\n if(options.alwaysCreateTextNode) val[options.textNodeName] = \"\";\n else val = \"\";\n }\n\n if(compressedObj[property] !== undefined) {\n if(!Array.isArray(compressedObj[property])) {\n compressedObj[property] = [ compressedObj[property] ];\n }\n compressedObj[property].push(val);\n }else{\n //TODO: if a node is not an array, then check if it should be an array\n //also determine if it is a leaf node\n if (options.isArray(property, newJpath, isLeaf )) {\n compressedObj[property] = [val];\n }else{\n compressedObj[property] = val;\n }\n }\n }\n \n }\n // if(text && text.length > 0) compressedObj[options.textNodeName] = text;\n if(typeof text === \"string\"){\n if(text.length > 0) compressedObj[options.textNodeName] = text;\n }else if(text !== undefined) compressedObj[options.textNodeName] = text;\n return compressedObj;\n}\n\nfunction propName(obj){\n const keys = Object.keys(obj);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if(key !== \"attributes\") return key;\n }\n}\n\nfunction assignAttributes(obj, attrMap, jpath, options){\n if (attrMap) {\n const keys = Object.keys(attrMap);\n const len = keys.length; //don't make it inline\n for (let i = 0; i < len; i++) {\n const atrrName = keys[i];\n if (options.isArray(atrrName, jpath + \".\" + atrrName, true, true)) {\n obj[atrrName] = [ attrMap[atrrName] ];\n } else {\n obj[atrrName] = attrMap[atrrName];\n }\n }\n }\n}\n\nfunction isLeafTag(obj, options){\n const propCount = Object.keys(obj).length;\n if( propCount === 0 || (propCount === 1 && obj[options.textNodeName]) ) return true;\n return false;\n}\nexports.prettify = prettify;\n","'use strict';\n\nclass XmlNode{\n constructor(tagname) {\n this.tagname = tagname;\n this.child = []; //nested tags, text, cdata, comments in order\n this.attributes = {}; //attributes map\n }\n add(key,val){\n // this.child.push( {name : key, val: val, isCdata: isCdata });\n this.child.push( {[key]: val });\n }\n addChild(node) {\n if(node.attributes && Object.keys(node.attributes).length > 0){\n this.child.push( { [node.tagname]: node.child, attributes: node.attributes });\n }else{\n this.child.push( { [node.tagname]: node.child });\n }\n };\n};\n\n\nmodule.exports = XmlNode;"],"sourceRoot":""} \ No newline at end of file diff --git a/lib/fxparser.min.js b/lib/fxparser.min.js index 697dace3..085b9e89 100644 --- a/lib/fxparser.min.js +++ b/lib/fxparser.min.js @@ -1,2 +1,2 @@ -var fxparser=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=2)}([function(t,e,r){"use strict";var n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i="["+n+"][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",a=new RegExp("^"+i+"$");e.isExist=function(t){return void 0!==t},e.isEmptyObject=function(t){return 0===Object.keys(t).length},e.merge=function(t,e,r){if(e)for(var n=Object.keys(e),i=n.length,a=0;a5&&"xml"===n)return h("InvalidXml","XML declaration allowed only at the start of the document.",g(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function u(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){var r=1;for(e+=8;e"===t[e]&&0===--r)break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e"===t[e+2]){e+=2;break}return e}e.validate=function(t,e){e=n.buildOptions(e,i,a);var r,f=[],p=!1,m=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(var b=0;b"!==t[b]&&" "!==t[b]&&"\t"!==t[b]&&"\n"!==t[b]&&"\r"!==t[b];b++)x+=t[b];if("/"===(x=x.trim())[x.length-1]&&(x=x.substring(0,x.length-1),b--),r=x,!n.isName(r)){return h("InvalidTag",0===x.trim().length?"Invalid space after '<'.":"Tag '"+x+"' is an invalid name.",g(t,b))}var y=l(t,b);if(!1===y)return h("InvalidAttr","Attributes for '"+x+"' have open quote.",g(t,b));var O=y.value;if(b=y.index,"/"===O[O.length-1]){var P=b-O.length,A=d(O=O.substring(0,O.length-1),e);if(!0!==A)return h(A.err.code,A.err.msg,g(t,P+A.err.line));p=!0}else if(N){if(!y.tagClosed)return h("InvalidTag","Closing tag '"+x+"' doesn't have proper closing.",g(t,b));if(O.trim().length>0)return h("InvalidTag","Closing tag '"+x+"' can't have attributes or invalid starting.",g(t,v));var F=f.pop();if(x!==F.tagName){var j=g(t,F.tagStartPos);return h("InvalidTag","Expected closing tag '"+F.tagName+"' (opened in line "+j.line+", col "+j.col+") instead of closing tag '"+x+"'.",g(t,v))}0==f.length&&(m=!0)}else{var E=d(O,e);if(!0!==E)return h(E.err.code,E.err.msg,g(t,b-O.length+E.err.line));if(!0===m)return h("InvalidXml","Multiple possible root nodes found.",g(t,b));f.push({tagName:x,tagStartPos:v}),p=!0}for(b++;b0)||h("InvalidXml","Invalid '"+JSON.stringify(f.map((function(t){return t.tagName})),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):h("InvalidXml","Start tag expected.",1)};function l(t,e){for(var r="",n="",i=!1;e"===t[e]&&""===n){i=!0;break}r+=t[e]}return""===n&&{value:r,index:e,tagClosed:i}}var f=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function d(t,e){for(var r=n.getAllMatches(t,f),i={},a=0;a))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,n.nameRegexp);function o(t,e,r,n,i,a,o){if(void 0!==t&&(e.trimValues&&!i&&(t=t.trim()),t.length>0)){var s=e.tagValueProcessor(r,t,n,a,o);return null==s?t:typeof s!=typeof t||s!==t?s:e.trimValues||t.trim()===t?u(t,e.parseTagValue,e.numberParseOptions):t}}function s(t,e){if(e.removeNSPrefix){var r=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===r[0])return"";2===r.length&&(t=n+r[1])}return t}function u(t,e,r){if(e&&"string"==typeof t){var i=t.trim();return"true"===i||"false"!==i&&a(t,r)}return n.isExist(t)?t:""}!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);var l=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function f(t,e,r){if(!r.ignoreAttributes&&"string"==typeof t){for(var i=n.getAllMatches(t,l),a=i.length,o={},f=0;f0))return!1;for(var i="",a=1;a"===a)return{data:n,index:i};"\t"===a&&(a=" ")}n+=a}}function h(t,e,r,n){var i=t.indexOf(e,r);if(-1===i)throw new Error(n);return i+e.length-1}e.parseToOrderedJsObj=function(t,e){t=t.replace(/\r\n?/g,"\n");for(var r=new i("!xml"),n=r,a="",s=[],u="",l=0;l",l,"Closing Tag is not closed."),g=t.substring(l+2,p).trim();if(e.removeNSPrefix){var m=g.indexOf(":");-1!==m&&(g=g.substr(m+1))}if(n&&(void 0!==(a=o(a,e,n.tagname,u,!1,!!n.attrsMap&&0!==Object.keys(n.attrsMap).length,0===Object.keys(n.child).length))&&""!==a&&n.add(e.textNodeName,a),a=""),d(e.stopNodes,s,n.tagname)){var b,v=s[s.length-1];v.child[v.child.length-1][n.tagname]=[(b={},b[e.textNodeName]=t.substr(n.startIndex+1,l-n.startIndex-1),b)]}u=u.substr(0,u.lastIndexOf(".")),n=s.pop(),a="",l=p}else if("?"===t[l+1])l=h(t,"?>",l,"Pi Tag is not closed.");else if("!--"===t.substr(l+1,3)){var N=h(t,"--\x3e",l,"Comment is not closed.");if(e.commentPropName){var x,y=t.substring(l+4,N-2);a&&(void 0!==(a=o(a,e,n.tagname,u,!1,!!n.attrsMap&&0!==Object.keys(n.attrsMap).length,0===Object.keys(n.child).length))&&""!==a&&n.add(e.textNodeName,a),a=""),n.add(e.commentPropName,[(x={},x[e.textNodeName]=y,x)])}l=N}else if("!D"===t.substr(l+1,2)){var O=h(t,">",l,"DOCTYPE is not closed.");l=t.substring(l,O).indexOf("[")>=0?t.indexOf("]>",l)+1:O}else if("!["===t.substr(l+1,2)){var P=h(t,"]]>",l,"CDATA is not closed.")-2,A=t.substring(l+9,P);if(a&&(void 0!==(a=o(a,e,n.tagname,u,!1,!!n.attrsMap&&0!==Object.keys(n.attrsMap).length,0===Object.keys(n.child).length))&&""!==a&&n.add(e.textNodeName,a),a=""),e.cdataPropName){var F,j=o(A,e,e.cdataPropName,u+"."+e.cdataPropName,!0,!1,!0);j||(j=""),n.add(e.cdataPropName,[(F={},F[e.textNodeName]=j,F)])}else{var E=o(A,e,n.tagname,u,!0,!1,!0);E||(E=""),n.add(e.textNodeName,E)}l=P+2}else{var w=c(t,l+1),C=w.data,T=w.index,I=C.search(/\s/),V=C,k=!0;if(-1!==I&&(V=C.substr(0,I).replace(/\s\s*$/,""),C=C.substr(I+1)),e.removeNSPrefix){var M=V.indexOf(":");-1!==M&&(k=(V=V.substr(M+1))!==w.data.substr(M+1))}if(n&&a&&"!xml"!==n.tagname&&(void 0!==(a=o(a,e,n.tagname,u,!1,!!n.attrsMap&&0!==Object.keys(n.attrsMap).length,!1))&&""!==a&&n.add(e.textNodeName,a),a=""),V!==r.tagname&&(u+=u?"."+V:V),C.length>0&&C.lastIndexOf("/")===C.length-1){C="/"===V[V.length-1]?V=V.substr(0,V.length-1):C.substr(0,C.length-1);var D=new i(V);V!==C&&k&&(D.attrsMap=f(C,u,e)),u=u.substr(0,u.lastIndexOf(".")),n.addChild(D)}else{var S=new i(V);s.push(n),S.startIndex=T,V!==C&&k&&(S.attrsMap=f(C,u,e)),n.addChild(S),n=S}a="",l=T}else a+=t[l]}return r.child}},function(t,e,r){"use strict";var n=function(){function t(t){this.tagname=t,this.child=[],this.attrsMap={}}var e=t.prototype;return e.add=function(t,e){var r;this.child.push(((r={})[t]=e,r))},e.addChild=function(t){var e,r;t.attrsMap&&Object.keys(t.attrsMap).length>0?this.child.push(((e={})[t.tagname]=t.child,e.attributes=t.attrsMap,e)):this.child.push(((r={})[t.tagname]=t.child,r))},t}();t.exports=n},function(t,e){const r=/^[-+]?0x[a-fA-F0-9]+$/,n=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/,i={hex:!0,leadingZeros:!0,decimalPoint:"."};t.exports=function(t,e={}){if(e=Object.assign({},i,e),!t||"string"!=typeof t)return t;let a=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(a))return t;if(e.hex&&r.test(a))return Number.parseInt(a,16);{const r=n.exec(a);if(r){r[1];const n=r[2],i=r[3];r[4]||r[6];return 1===n.length&&"."===i[0]?Number(t):!e.leadingZeros&&n.length>0?t:Number(a)}return t}}},function(t,e,r){"use strict";function n(t){for(var e=Object.keys(t),r=0;r0&&(u[r.textNodeName]=s):void 0!==s&&(u[r.textNodeName]=s);return u}(t,e)}},function(t,e,r){"use strict";var n=r(0).buildOptions,i=r(10),a={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1},o=["attributeNamePrefix","attributesGroupName","textNodeName","ignoreAttributes","cdataPropName","format","indentBy","suppressEmptyNode","tagValueProcessor","attributeValueProcessor","arrayNodeName","preserveOrder","commentPropName"];function s(t){this.options=n(t,a,o),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=p),this.processTextOrObjNode=u,this.options.format?(this.indentate=h,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""),this.options.suppressEmptyNode?(this.buildTextNode=c,this.buildObjNode=f):(this.buildTextNode=d,this.buildObjNode=l),this.buildTextValNode=d,this.buildObjectNode=l}function u(t,e,r){var n=this.j2x(t,r+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextNode(n.val,e,n.attrStr,r):this.buildObjNode(n.val,e,n.attrStr,r)}function l(t,e,r,n){return r&&-1===t.indexOf("<")?this.indentate(n)+"<"+e+r+">"+t+""+this.options.tagValueProcessor(e,t)+"1&&((e={})[this.options.arrayNodeName]=t,t=e),this.j2x(t,0).val);var e},s.prototype.j2x=function(t,e){var r="",n="";for(var i in t)if(void 0===t[i]);else if(null===t[i])n+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(t[i]instanceof Date)n+=this.buildTextNode(t[i],i,"",e);else if("object"!=typeof t[i]){var a=this.isAttribute(i);a?r+=" "+a+'="'+this.options.attributeValueProcessor(a,""+t[i])+'"':i===this.options.textNodeName?n+=this.options.tagValueProcessor(i,""+t[i]):n+=this.buildTextNode(t[i],i,"",e)}else if(Array.isArray(t[i]))for(var o=t[i].length,s=0;s0&&(u=n+""+r.indentBy.repeat(o));for(var l=0;l"+p+u+"":s+=h+"/>"}else s+=u+"\x3c!--"+f[d][0][r.textNodeName]+"--\x3e";else s+=u+"";else s+=u+r.tagValueProcessor(d,f[d])}return s}(t,e,0)}},function(t,e){e.endianness=function(){return"LE"},e.hostname=function(){return"undefined"!=typeof location?location.hostname:""},e.loadavg=function(){return[]},e.uptime=function(){return 0},e.freemem=function(){return Number.MAX_VALUE},e.totalmem=function(){return Number.MAX_VALUE},e.cpus=function(){return[]},e.type=function(){return"Browser"},e.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},e.networkInterfaces=e.getNetworkInterfaces=function(){return{}},e.arch=function(){return"javascript"},e.platform=function(){return"browser"},e.tmpdir=e.tmpDir=function(){return"/tmp"},e.EOL="\n",e.homedir=function(){return"/"}}]); +var fxparser=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=2)}([function(t,e,r){"use strict";var n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i="["+n+"][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",a=new RegExp("^"+i+"$");e.isExist=function(t){return void 0!==t},e.isEmptyObject=function(t){return 0===Object.keys(t).length},e.merge=function(t,e,r){if(e)for(var n=Object.keys(e),i=n.length,a=0;a5&&"xml"===n)return h("InvalidXml","XML declaration allowed only at the start of the document.",g(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function u(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){var r=1;for(e+=8;e"===t[e]&&0===--r)break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e"===t[e+2]){e+=2;break}return e}e.validate=function(t,e){e=n.buildOptions(e,i,a);var r,f=[],p=!1,b=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(var m=0;m"!==t[m]&&" "!==t[m]&&"\t"!==t[m]&&"\n"!==t[m]&&"\r"!==t[m];m++)x+=t[m];if("/"===(x=x.trim())[x.length-1]&&(x=x.substring(0,x.length-1),m--),r=x,!n.isName(r)){return h("InvalidTag",0===x.trim().length?"Invalid space after '<'.":"Tag '"+x+"' is an invalid name.",g(t,m))}var y=l(t,m);if(!1===y)return h("InvalidAttr","Attributes for '"+x+"' have open quote.",g(t,m));var O=y.value;if(m=y.index,"/"===O[O.length-1]){var P=m-O.length,A=d(O=O.substring(0,O.length-1),e);if(!0!==A)return h(A.err.code,A.err.msg,g(t,P+A.err.line));p=!0}else if(N){if(!y.tagClosed)return h("InvalidTag","Closing tag '"+x+"' doesn't have proper closing.",g(t,m));if(O.trim().length>0)return h("InvalidTag","Closing tag '"+x+"' can't have attributes or invalid starting.",g(t,v));var F=f.pop();if(x!==F.tagName){var T=g(t,F.tagStartPos);return h("InvalidTag","Expected closing tag '"+F.tagName+"' (opened in line "+T.line+", col "+T.col+") instead of closing tag '"+x+"'.",g(t,v))}0==f.length&&(b=!0)}else{var j=d(O,e);if(!0!==j)return h(j.err.code,j.err.msg,g(t,m-O.length+j.err.line));if(!0===b)return h("InvalidXml","Multiple possible root nodes found.",g(t,m));-1!==e.unpairedTags.indexOf(x)||f.push({tagName:x,tagStartPos:v}),p=!0}for(m++;m0)||h("InvalidXml","Invalid '"+JSON.stringify(f.map((function(t){return t.tagName})),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):h("InvalidXml","Start tag expected.",1)};function l(t,e){for(var r="",n="",i=!1;e"===t[e]&&""===n){i=!0;break}r+=t[e]}return""===n&&{value:r,index:e,tagClosed:i}}var f=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function d(t,e){for(var r=n.getAllMatches(t,f),i={},a=0;a))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,n.nameRegexp);function s(t,e,r,n,i,a,s){if(void 0!==t&&(e.trimValues&&!i&&(t=t.trim()),t.length>0)){var o=e.tagValueProcessor(r,t,n,a,s);return null==o?t:typeof o!=typeof t||o!==t?o:e.trimValues||t.trim()===t?u(t,e.parseTagValue,e.numberParseOptions):t}}function o(t,e){if(e.removeNSPrefix){var r=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===r[0])return"";2===r.length&&(t=n+r[1])}return t}function u(t,e,r){if(e&&"string"==typeof t){var i=t.trim();return"true"===i||"false"!==i&&a(t,r)}return n.isExist(t)?t:""}!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);var l=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function f(t,e,r){if(!r.ignoreAttributes&&"string"==typeof t){for(var i=n.getAllMatches(t,l),a=i.length,s={},f=0;f0))return!1;for(var i="",a=1;a"===a)return{data:n,index:i};"\t"===a&&(a=" ")}n+=a}}function h(t,e,r,n){var i=t.indexOf(e,r);if(-1===i)throw new Error(n);return i+e.length-1}e.parseToOrderedJsObj=function(t,e){t=t.replace(/\r\n?/g,"\n");for(var r=new i("!xml"),n=r,a="",o=[],u="",l=0;l",l,"Closing Tag is not closed."),g=t.substring(l+2,p).trim();if(e.removeNSPrefix){var b=g.indexOf(":");-1!==b&&(g=g.substr(b+1))}if(n&&(void 0!==(a=s(a,e,n.tagname,u,!1,!!n.attributes&&0!==Object.keys(n.attributes).length,0===Object.keys(n.child).length))&&""!==a&&n.add(e.textNodeName,a),a=""),d(e.stopNodes,o,n.tagname)){var m,v=o[o.length-1];v.child[v.child.length-1][n.tagname]=[(m={},m[e.textNodeName]=t.substr(n.startIndex+1,l-n.startIndex-1),m)]}u=u.substr(0,u.lastIndexOf(".")),n=o.pop(),a="",l=p}else if("?"===t[l+1])l=h(t,"?>",l,"Pi Tag is not closed.");else if("!--"===t.substr(l+1,3)){var N=h(t,"--\x3e",l,"Comment is not closed.");if(e.commentPropName){var x,y=t.substring(l+4,N-2);a&&(void 0!==(a=s(a,e,n.tagname,u,!1,!!n.attributes&&0!==Object.keys(n.attributes).length,0===Object.keys(n.child).length))&&""!==a&&n.add(e.textNodeName,a),a=""),n.add(e.commentPropName,[(x={},x[e.textNodeName]=y,x)])}l=N}else if("!D"===t.substr(l+1,2)){var O=h(t,">",l,"DOCTYPE is not closed.");l=t.substring(l,O).indexOf("[")>=0?t.indexOf("]>",l)+1:O}else if("!["===t.substr(l+1,2)){var P=h(t,"]]>",l,"CDATA is not closed.")-2,A=t.substring(l+9,P);if(a&&(void 0!==(a=s(a,e,n.tagname,u,!1,!!n.attributes&&0!==Object.keys(n.attributes).length,0===Object.keys(n.child).length))&&""!==a&&n.add(e.textNodeName,a),a=""),e.cdataPropName){var F,T=s(A,e,e.cdataPropName,u+"."+e.cdataPropName,!0,!1,!0);T||(T=""),n.add(e.cdataPropName,[(F={},F[e.textNodeName]=T,F)])}else{var j=s(A,e,n.tagname,u,!0,!1,!0);j||(j=""),n.add(e.textNodeName,j)}l=P+2}else{var E=c(t,l+1),w=E.data,C=E.index,I=w.search(/\s/),V=w,k=!0;if(-1!==I&&(V=w.substr(0,I).replace(/\s\s*$/,""),w=w.substr(I+1)),e.removeNSPrefix){var D=V.indexOf(":");-1!==D&&(k=(V=V.substr(D+1))!==E.data.substr(D+1))}if(n&&a&&"!xml"!==n.tagname&&(void 0!==(a=s(a,e,n.tagname,u,!1,!!n.attributes&&0!==Object.keys(n.attributes).length,!1))&&""!==a&&n.add(e.textNodeName,a),a=""),V!==r.tagname&&(u+=u?"."+V:V),w.length>0&&w.lastIndexOf("/")===w.length-1){w="/"===V[V.length-1]?V=V.substr(0,V.length-1):w.substr(0,w.length-1);var S=new i(V);V!==w&&k&&(S.attributes=f(w,u,e)),u=u.substr(0,u.lastIndexOf(".")),n.addChild(S)}else if(-1!==e.unpairedTags.indexOf(V)){var M=new i(V);V!==w&&k&&(M.attributes=f(w,u,e)),u=u.substr(0,u.lastIndexOf(".")),n.addChild(M)}else{var L=new i(V);o.push(n),L.startIndex=C,V!==w&&k&&(L.attributes=f(w,u,e)),n.addChild(L),n=L}a="",l=C}else a+=t[l]}return r.child}},function(t,e,r){"use strict";var n=function(){function t(t){this.tagname=t,this.child=[],this.attributes={}}var e=t.prototype;return e.add=function(t,e){var r;this.child.push(((r={})[t]=e,r))},e.addChild=function(t){var e,r;t.attributes&&Object.keys(t.attributes).length>0?this.child.push(((e={})[t.tagname]=t.child,e.attributes=t.attributes,e)):this.child.push(((r={})[t.tagname]=t.child,r))},t}();t.exports=n},function(t,e){const r=/^[-+]?0x[a-fA-F0-9]+$/,n=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/,i={hex:!0,leadingZeros:!0,decimalPoint:"."};t.exports=function(t,e={}){if(e=Object.assign({},i,e),!t||"string"!=typeof t)return t;let a=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(a))return t;if(e.hex&&r.test(a))return Number.parseInt(a,16);{const r=n.exec(a);if(r){r[1];const n=r[2],i=r[3];r[4]||r[6];return 1===n.length&&"."===i[0]?Number(t):!e.leadingZeros&&n.length>0?t:Number(a)}return t}}},function(t,e,r){"use strict";function n(t){for(var e=Object.keys(t),r=0;r0&&(u[r.textNodeName]=o):void 0!==o&&(u[r.textNodeName]=o);return u}(t,e)}},function(t,e,r){"use strict";var n=r(0).buildOptions,i=r(10),a={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[]},s=["attributeNamePrefix","attributesGroupName","textNodeName","ignoreAttributes","cdataPropName","format","indentBy","suppressEmptyNode","tagValueProcessor","attributeValueProcessor","arrayNodeName","preserveOrder","commentPropName","unpairedTags"];function o(t){this.options=n(t,a,s),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=p),this.processTextOrObjNode=u,this.options.format?(this.indentate=h,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""),this.options.suppressEmptyNode?(this.buildTextNode=c,this.buildObjNode=f):(this.buildTextNode=d,this.buildObjNode=l),this.buildTextValNode=d,this.buildObjectNode=l}function u(t,e,r){var n=this.j2x(t,r+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextNode(n.val,e,n.attrStr,r):this.buildObjNode(n.val,e,n.attrStr,r)}function l(t,e,r,n){return r&&-1===t.indexOf("<")?this.indentate(n)+"<"+e+r+">"+t+""+this.options.tagValueProcessor(e,t)+"1&&((e={})[this.options.arrayNodeName]=t,t=e),this.j2x(t,0).val);var e},o.prototype.j2x=function(t,e){var r="",n="";for(var i in t)if(void 0===t[i]);else if(null===t[i])n+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(t[i]instanceof Date)n+=this.buildTextNode(t[i],i,"",e);else if("object"!=typeof t[i]){var a=this.isAttribute(i);a?r+=" "+a+'="'+this.options.attributeValueProcessor(a,""+t[i])+'"':i===this.options.textNodeName?n+=this.options.tagValueProcessor(i,""+t[i]):n+=this.buildTextNode(t[i],i,"",e)}else if(Array.isArray(t[i]))for(var s=t[i].length,o=0;o0&&(u=n+""+r.indentBy.repeat(s));for(var l=0;l"+p+u+"":-1!==r.unpairedTags.indexOf(d)?o+=h+">":o+=h+"/>"}else o+=u+"\x3c!--"+f[d][0][r.textNodeName]+"--\x3e";else o+=u+"";else o+=u+r.tagValueProcessor(d,f[d])}return o}(t,e,0)}},function(t,e){e.endianness=function(){return"LE"},e.hostname=function(){return"undefined"!=typeof location?location.hostname:""},e.loadavg=function(){return[]},e.uptime=function(){return 0},e.freemem=function(){return Number.MAX_VALUE},e.totalmem=function(){return Number.MAX_VALUE},e.cpus=function(){return[]},e.type=function(){return"Browser"},e.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},e.networkInterfaces=e.getNetworkInterfaces=function(){return{}},e.arch=function(){return"javascript"},e.platform=function(){return"browser"},e.tmpdir=e.tmpDir=function(){return"/tmp"},e.EOL="\n",e.homedir=function(){return"/"}}]); //# sourceMappingURL=fxparser.min.js.map \ No newline at end of file diff --git a/lib/fxparser.min.js.map b/lib/fxparser.min.js.map index fc9d74fc..ffde4548 100644 --- a/lib/fxparser.min.js.map +++ b/lib/fxparser.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://fxparser/lib/fxparser.min.js"],"names":["fxparser","modules","installedModules","__webpack_require__","moduleId","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","nameStartChar","nameRegexp","regexName","RegExp","isExist","v","isEmptyObject","obj","keys","length","merge","target","a","arrayMode","len","getValue","buildOptions","options","defaultOptions","props","newOptions","undefined","isName","string","match","exec","getAllMatches","regex","matches","allmatches","startIndex","lastIndex","index","push","util","allowBooleanAttributes","isWhiteSpace","_char","readPI","xmlData","start","tagname","substr","getErrorObject","getLineNumberForPosition","readCommentAndCDATA","angleBracketsCount","validate","tags","tagFound","reachedRoot","err","tagStartPos","closingTag","tagName","trim","substring","result","readAttributeStr","attrStr","attrStrStart","isValid","validateAttributeString","code","msg","line","tagClosed","otg","pop","openPos","col","_isValid","afterAmp","validateAmpersand","JSON","stringify","map","replace","startChar","validAttrStrRegxp","attrNames","getPositionFromMatch","attrName","validateAttrName","re","validateNumberAmpersand","count","message","lineNumber","lines","split","validator","XMLParser","XMLBuilder","XMLValidator","parseToOrderedJsObj","prettify","this","parse","validationOption","toString","Error","orderedResult","preserveOrder","attributeNamePrefix","attributesGroupName","textNodeName","ignoreAttributes","removeNSPrefix","parseTagValue","parseAttributeValue","trimValues","cdataPropName","numberParseOptions","hex","leadingZeros","tagValueProcessor","val","attributeValueProcessor","stopNodes","alwaysCreateTextNode","isArray","commentPropName","xmlNode","toNumber","parseValue","jPath","dontTrim","hasAttributes","isLeafNode","newval","_parseValue","resolveNameSpace","prefix","charAt","shouldParse","Number","parseInt","window","parseFloat","attrsRegx","buildAttributesMap","attrs","oldVal","aName","newVal","attrCollection","isItStopNode","tagsNodeStack","currentTagName","matchingStopNodes","forEach","_i","tagExpWithClosingIndex","attrBoundary","tagExp","ch","data","findClosingIndex","str","errMsg","closingIndex","indexOf","xmlObj","currentNode","textData","closeIndex","colonIndex","attrsMap","child","add","_ref","top","lastIndexOf","endIndex","_ref2","comment","_closeIndex","_closeIndex2","_tagExp","_ref3","_val","_tagExp2","_closeIndex3","separatorIndex","search","_tagName","shouldBuildAttributesMap","_colonIndex","childNode","addChild","_childNode","XmlNode","_proto","_this$child$push","node","_this$child$push2","_this$child$push3","attributes","hexRegex","numRegex","consider","decimalPoint","assign","trimmedStr","skipLike","test","num","propName","assignAttributes","attrMap","jpath","atrrName","isLeafTag","propCount","compress","arr","text","compressedObj","tagObj","newJpath","isLeaf","Array","buildFromOrderedJs","format","indentBy","suppressEmptyNode","Builder","isAttribute","attrPrefixLen","processTextOrObjNode","indentate","tagEndChar","newLine","buildTextNode","buildEmptyTextNode","buildObjNode","buildEmptyObjNode","buildTextValNode","buildObjectNode","level","j2x","repeat","startsWith","build","jObj","arrayNodeName","_jObj","Date","attr","arrLen","j","item","Ks","L","_j","EOL","attr_to_str","jArray","arrToStr","xmlStr","indentation","attStr","tagStart","tagValue","endianness","hostname","location","loadavg","uptime","freemem","MAX_VALUE","totalmem","cpus","type","release","navigator","appVersion","networkInterfaces","getNetworkInterfaces","arch","platform","tmpdir","tmpDir","homedir"],"mappings":"AAAA,IAAIA,SACK,SAAUC,GAET,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAJ,EAAQG,GAAUK,KAAKH,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBO,EAAIT,EAGxBE,EAAoBQ,EAAIT,EAGxBC,EAAoBS,EAAI,SAASP,EAASQ,EAAMC,GAC3CX,EAAoBY,EAAEV,EAASQ,IAClCG,OAAO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AAO,IAGTlT,EAAQmT,KAAO,WACb,MAAO,WAGTnT,EAAQoT,QAAU,WAChB,MAAyB,oBAAdC,UACFA,UAAUC,WAGZ,IAGTtT,EAAQuT,kBAAoBvT,EAAQwT,qBAAuB,WACzD,MAAO,IAGTxT,EAAQyT,KAAO,WACb,MAAO,cAGTzT,EAAQ0T,SAAW,WACjB,MAAO,WAGT1T,EAAQ2T,OAAS3T,EAAQ4T,OAAS,WAChC,MAAO,QAGT5T,EAAQiS,IAAM,KAEdjS,EAAQ6T,QAAU,WAChB,MAAO","file":"./lib/fxparser.min.js","sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://fxparser/lib/fxparser.min.js"],"names":["fxparser","modules","installedModules","__webpack_require__","moduleId","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","nameStartChar","nameRegexp","regexName","RegExp","isExist","v","isEmptyObject","obj","keys","length","merge","target","a","arrayMode","len","getValue","buildOptions","options","defaultOptions","props","newOptions","undefined","isName","string","match","exec","getAllMatches","regex","matches","allmatches","startIndex","lastIndex","index","push","util","allowBooleanAttributes","unpairedTags","isWhiteSpace","_char","readPI","xmlData","start","tagname","substr","getErrorObject","getLineNumberForPosition","readCommentAndCDATA","angleBracketsCount","validate","tags","tagFound","reachedRoot","err","tagStartPos","closingTag","tagName","trim","substring","result","readAttributeStr","attrStr","attrStrStart","isValid","validateAttributeString","code","msg","line","tagClosed","otg","pop","openPos","col","_isValid","indexOf","afterAmp","validateAmpersand","JSON","stringify","map","replace","startChar","validAttrStrRegxp","attrNames","getPositionFromMatch","attrName","validateAttrName","re","validateNumberAmpersand","count","message","lineNumber","lines","split","validator","XMLParser","XMLBuilder","XMLValidator","parseToOrderedJsObj","prettify","this","parse","validationOption","toString","Error","orderedResult","preserveOrder","attributeNamePrefix","attributesGroupName","textNodeName","ignoreAttributes","removeNSPrefix","parseTagValue","parseAttributeValue","trimValues","cdataPropName","numberParseOptions","hex","leadingZeros","tagValueProcessor","val","attributeValueProcessor","stopNodes","alwaysCreateTextNode","isArray","commentPropName","xmlNode","toNumber","parseValue","jPath","dontTrim","hasAttributes","isLeafNode","newval","_parseValue","resolveNameSpace","prefix","charAt","shouldParse","Number","parseInt","window","parseFloat","attrsRegx","buildAttributesMap","attrs","oldVal","aName","newVal","attrCollection","isItStopNode","tagsNodeStack","currentTagName","matchingStopNodes","forEach","_i","tagExpWithClosingIndex","attrBoundary","tagExp","ch","data","findClosingIndex","str","errMsg","closingIndex","xmlObj","currentNode","textData","closeIndex","colonIndex","attributes","child","add","_ref","top","lastIndexOf","endIndex","_ref2","comment","_closeIndex","_closeIndex2","_tagExp","_ref3","_val","_tagExp2","_closeIndex3","separatorIndex","search","_tagName","shouldBuildAttributesMap","_colonIndex","childNode","addChild","_childNode","_childNode2","XmlNode","_proto","_this$child$push","node","_this$child$push2","_this$child$push3","hexRegex","numRegex","consider","decimalPoint","assign","trimmedStr","skipLike","test","num","propName","assignAttributes","attrMap","jpath","atrrName","isLeafTag","propCount","compress","arr","text","compressedObj","tagObj","newJpath","isLeaf","Array","buildFromOrderedJs","format","indentBy","suppressEmptyNode","Builder","isAttribute","attrPrefixLen","processTextOrObjNode","indentate","tagEndChar","newLine","buildTextNode","buildEmptyTextNode","buildObjNode","buildEmptyObjNode","buildTextValNode","buildObjectNode","level","j2x","repeat","startsWith","build","jObj","arrayNodeName","_jObj","Date","attr","arrLen","j","item","Ks","L","_j","EOL","attr_to_str","jArray","arrToStr","xmlStr","indentation","attStr","tagStart","tagValue","endianness","hostname","location","loadavg","uptime","freemem","MAX_VALUE","totalmem","cpus","type","release","navigator","appVersion","networkInterfaces","getNetworkInterfaces","arch","platform","tmpdir","tmpDir","homedir"],"mappings":"AAAA,IAAIA,SACK,SAAUC,GAET,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAA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min.js","sourceRoot":""} \ No newline at end of file diff --git a/spec/unpairedTags_spec.js b/spec/unpairedTags_spec.js new file mode 100644 index 00000000..1e31532e --- /dev/null +++ b/spec/unpairedTags_spec.js @@ -0,0 +1,80 @@ +"use strict"; + +const {XMLParser, XMLBuilder} = require("../src/fxp"); + +describe("unpaired and empty tags", function() { + + it("should be parsed with paired tag when suppressEmptyNode:false", function() { + const xmlData = ` + value + + + `; + const expectedXmlData = ` + value + + + `; + + const options = { + // format: true, + // preserveOrder: true, + // suppressEmptyNode: true, + unpairedTags: ["unpaired"] + }; + const parser = new XMLParser(options); + let result = parser.parse(xmlData); + // console.log(JSON.stringify(result, null,4)); + + const builder = new XMLBuilder(options); + const output = builder.build(result); + // console.log(output); + expect(output.replace(/\s+/g, "")).toEqual(expectedXmlData.replace(/\s+/g, "")); + }); + + it("should be parsed without paired tag when suppressEmptyNode:true", function() { + const xmlData = ` + value + + + `; + + const options = { + // format: true, + // preserveOrder: true, + suppressEmptyNode: true, + unpairedTags: ["unpaired"] + }; + const parser = new XMLParser(options); + let result = parser.parse(xmlData); + // console.log(JSON.stringify(result, null,4)); + + const builder = new XMLBuilder(options); + const output = builder.build(result); + // console.log(output); + expect(output.replace(/\s+/g, "")).toEqual(xmlData.replace(/\s+/g, "")); + }); + + it("should be parsed without paired tag when suppressEmptyNode:true and tags order is preserved", function() { + const xmlData = ` + value + + + `; + + const options = { + // format: true, + // preserveOrder: true, + suppressEmptyNode: true, + unpairedTags: ["unpaired"] + }; + const parser = new XMLParser(options); + let result = parser.parse(xmlData); + // console.log(JSON.stringify(result, null,4)); + + const builder = new XMLBuilder(options); + const output = builder.build(result); + // console.log(output); + expect(output.replace(/\s+/g, "")).toEqual(xmlData.replace(/\s+/g, "")); + }); +}); diff --git a/spec/validator_spec.js b/spec/validator_spec.js index 35e8481d..5394d02d 100644 --- a/spec/validator_spec.js +++ b/spec/validator_spec.js @@ -433,3 +433,28 @@ describe("should report correct line numbers for unclosed tags", () => { extra`, {InvalidXml: "Extra text at the end"}, 2, 28)); }); + +describe("XML Validator with options", function () { + it('- Unpaired tags', () => + validate(``, + {InvalidTag: "Expected closing tag 'extra' (opened in line 1, col 9) instead of closing tag 'parent'."}, 1, 16)); + + it('- Maarked Unpaired tags', () =>{ + const result = XMLValidator.validate(``, { + unpairedTags: ["extra"] + }); + // console.log(result); + expect(result).toBeTrue(); + }); + it('- allowBooleanAttributes:false', () => + validate(``, + {InvalidAttr: "boolean attribute 'extra' is not allowed."}, 1, 9)); + + it('- allowBooleanAttributes:true', () =>{ + const result = XMLValidator.validate(``, { + allowBooleanAttributes: true + }); + expect(result).toBeTrue(); + }); + +}); \ No newline at end of file diff --git a/src/fxp.d.ts b/src/fxp.d.ts index 67fc6b50..56bdf08d 100644 --- a/src/fxp.d.ts +++ b/src/fxp.d.ts @@ -15,6 +15,7 @@ type X2jOptions = { attributeValueProcessor: (attrName: string, attrValue: string, jPath: string) => string; numberParseOptions: strnumOptions; stopNodes: string[]; + unpairedTags: string[]; alwaysCreateTextNode: boolean; isArray: (tagName: string, jPath: string, isLeafNode: boolean, isAttribute: boolean) => boolean; }; @@ -26,6 +27,7 @@ type strnumOptions = { type X2jOptionsOptional = Partial; type validationOptions = { allowBooleanAttributes: boolean; + unpairedTags: string[]; }; type validationOptionsOptional = Partial; @@ -41,6 +43,7 @@ type XmlBuilderOptions = { arrayNodeName: string; suppressEmptyNode: boolean; preserveOrder: boolean; + unpairedTags: string[]; tagValueProcessor: (name: string, value: string) => string; attributeValueProcessor: (name: string, value: string) => string; }; diff --git a/src/validator.js b/src/validator.js index 72b9d965..670f929d 100644 --- a/src/validator.js +++ b/src/validator.js @@ -4,9 +4,13 @@ const util = require('./util'); const defaultOptions = { allowBooleanAttributes: false, //A tag can have attributes without any value + unpairedTags: [] }; -const props = ['allowBooleanAttributes']; +const props = [ + 'allowBooleanAttributes', + 'unpairedTags' +]; //const tagsPattern = new RegExp("<\\/?([\\w:\\-_\.]+)\\s*\/?>","g"); exports.validate = function (xmlData, options) { @@ -130,6 +134,8 @@ exports.validate = function (xmlData, options) { //if the root level has been reached before ... if (reachedRoot === true) { return getErrorObject('InvalidXml', 'Multiple possible root nodes found.', getLineNumberForPosition(xmlData, i)); + } else if(options.unpairedTags.indexOf(tagName) !== -1){ + //don't push into stack } else { tags.push({tagName, tagStartPos}); } diff --git a/src/xmlbuilder/json2xml.js b/src/xmlbuilder/json2xml.js index 6e5e6646..17fdef45 100644 --- a/src/xmlbuilder/json2xml.js +++ b/src/xmlbuilder/json2xml.js @@ -19,7 +19,8 @@ const defaultOptions = { return a; }, preserveOrder: false, - commentPropName: false + commentPropName: false, + unpairedTags: [], }; const props = [ @@ -36,6 +37,7 @@ const props = [ 'arrayNodeName', //when array as root 'preserveOrder', "commentPropName", + "unpairedTags", // 'rootNodeName', //when jsObject have multiple properties on root level ]; @@ -208,7 +210,9 @@ function buildTextValNode(val, key, attrStr, level) { } function buildEmptyTextNode(val, key, attrStr, level) { - if (val !== '') { + if( val === '' && this.options.unpairedTags.indexOf(key) !== -1){ + return this.indentate(level) + '<' + key + attrStr + this.tagEndChar; + }else if (val !== '') { return this.buildTextValNode(val, key, attrStr, level); } else { return this.indentate(level) + '<' + key + attrStr + '/' + this.tagEndChar; @@ -227,8 +231,4 @@ function isAttribute(name /*, options*/) { } } -//formatting -//indentation -//\n after each closing or self closing tag - module.exports = Builder; diff --git a/src/xmlbuilder/orderedJs2Xml.js b/src/xmlbuilder/orderedJs2Xml.js index 5c585520..460f48f3 100644 --- a/src/xmlbuilder/orderedJs2Xml.js +++ b/src/xmlbuilder/orderedJs2Xml.js @@ -36,7 +36,11 @@ function arrToStr(arr, options, level){ let tagStart = indentation + `<${tagName}${attStr}`; let tagValue = arrToStr(tagObj[tagName], options, level + 1); if( (!tagValue || tagValue.length === 0) && options.suppressEmptyNode){ - xmlStr += tagStart + "/>"; + if(options.unpairedTags.indexOf(tagName) !== -1){ + xmlStr += tagStart + ">"; + }else{ + xmlStr += tagStart + "/>"; + } }else{ //TODO: node with only text value should not parse the text value in next line xmlStr += tagStart + `>${tagValue}${indentation}` ; diff --git a/src/xmlparser/OptionsBuilder.js b/src/xmlparser/OptionsBuilder.js index 5048cc74..1cb33c6b 100644 --- a/src/xmlparser/OptionsBuilder.js +++ b/src/xmlparser/OptionsBuilder.js @@ -26,6 +26,7 @@ const defaultOptions = { alwaysCreateTextNode: false, isArray: () => false, commentPropName: false, + unpairedTags: [], }; const props = [ @@ -46,7 +47,8 @@ const props = [ 'stopNodes', 'alwaysCreateTextNode', 'isArray', - 'commentPropName' + 'commentPropName', + 'unpairedTags', ]; const util = require('../util'); diff --git a/src/xmlparser/OrderedObjParser.js b/src/xmlparser/OrderedObjParser.js index ee9d3785..ab6fef5e 100644 --- a/src/xmlparser/OrderedObjParser.js +++ b/src/xmlparser/OrderedObjParser.js @@ -297,6 +297,18 @@ const parseToOrderedJsObj = function(xmlData, options) { tagExp = tagExp.substr(0, tagExp.length - 1); } + const childNode = new xmlNode(tagName); + if(tagName !== tagExp && shouldBuildAttributesMap){ + childNode.attributes = buildAttributesMap(tagExp, jPath , options); + } + jPath = jPath.substr(0, jPath.lastIndexOf(".")); + // tagsNodeStack.push(currentNode); + currentNode.addChild(childNode); + } + //boolean tags + else if(options.unpairedTags.indexOf(tagName) !== -1){ + // tagExp = tagExp.substr(0, tagExp.length - 1); + const childNode = new xmlNode(tagName); if(tagName !== tagExp && shouldBuildAttributesMap){ childNode.attributes = buildAttributesMap(tagExp, jPath , options);