{"version":3,"sources":["webpack://parser/webpack/bootstrap","webpack://parser/./src/json2xml.js","webpack://parser/./src/nimndata.js","webpack://parser/./src/node2json.js","webpack://parser/./src/node2json_str.js","webpack://parser/./src/parser.js","webpack://parser/./src/util.js","webpack://parser/./src/validator.js","webpack://parser/./src/xmlNode.js","webpack://parser/./src/xmlstr2xmlnode.js"],"names":["buildOptions","require","defaultOptions","attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","cdataTagName","cdataPositionChar","format","indentBy","supressEmptyNode","tagValueProcessor","a","attrValueProcessor","props","Parser","options","isAttribute","attrPrefixLen","length","isCDATA","replaceCDATAstr","replaceCDATAarr","indentate","tagEndChar","newLine","buildTextNode","buildEmptyTextNode","buildObjNode","buildEmptyObjNode","buildTextValNode","buildObjectNode","prototype","parse","jObj","j2x","val","level","attrStr","keys","Object","len","i","key","Date","attr","Array","isArray","arrLen","j","item","result","Ks","L","str","cdata","replace","join","v","includes","repeat","name","startsWith","substr","module","exports","char","String","fromCharCode","chars","nilChar","missingChar","nilPremitive","missingPremitive","emptyChar","emptyValue","boundryChar","objStart","arrStart","arrayEnd","charsArr","_e","node","e_schema","undefined","getValue","hasValidData","hasData","itemSchema","arr_len","arr_i","r","processValue","attrsMap","child","isAppChar","ch","indexOf","x2j","convert2nimn","util","convertToJson","isEmptyObject","isExist","merge","index","tagname","tag","push","convertToJsonString","_cToJsonStr","stringval","isNaN","nodeToJson","xmlToNodeobj","x2xmlnode","xmlData","getTraversalObj","convertTonimn","validate","j2xParser","parseToNimn","schema","getAllMatches","string","regex","matches","match","exec","allmatches","doesMatch","doesNotMatch","obj","target","newOptions","allowBooleanAttributes","localeRange","tags","tagFound","regxAttrName","RegExp","regxTagName","readPI","err","readCommentAndCDATA","closingTag","tagName","trim","substring","validateTagName","code","msg","readAttributeStr","value","isValid","validateAttributeString","tagClosed","otg","pop","JSON","stringify","start","angleBracketsCount","doubleQuote","singleQuote","startChar","validAttrStrRegxp","attrNames","attrName","validateAttrName","hasOwnProperty","parent","addChild","xmlNode","TagType","OPENING","CLOSING","SELF","CDATA","regx","Number","parseInt","window","parseFloat","ignoreNameSpace","parseNodeValue","parseAttributeValue","arrayMode","trimValues","stopNodes","xmlObj","currentNode","tagsRegx","nextTag","tagType","checkForTagType","processTagValue","startIndex","childNode","buildAttributesMap","parseValue","parseTrueNumberOnly","resolveNameSpace","split","prefix","charAt","shouldParse","parsed","attrsRegx","attrs","attrCollection"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;ACjFA;AACA,GAAMA,aAAY,CAAGC,mBAAO,CAAC,6BAAD,CAAP,CAAkBD,YAAvC,CAEA,GAAME,eAAc,CAAG,CACrBC,mBAAmB,CAAE,IADA,CAErBC,YAAY,CAAE,KAFO,CAGrBC,YAAY,CAAE,OAHO,CAIrBC,gBAAgB,CAAE,IAJG,CAKrBC,YAAY,CAAE,KALO,CAMrBC,iBAAiB,CAAE,KANE,CAOrBC,MAAM,CAAE,KAPa,CAQrBC,QAAQ,CAAE,IARW,CASrBC,gBAAgB,CAAE,KATG,CAUrBC,iBAAiB,CAAE,2BAASC,CAAT,CAAY,CAC7B,MAAOA,EAAP,CACD,CAZoB,CAarBC,k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T,CAAd,CAAuC8M,KAAvC,CACA,MAAOC,eAAP,CACD,CACD,MAAOD,MAAP,CACD,CACF,CAEDhJ,OAAO,CAACoD,eAAR,CAA0BA,eAA1B,C","file":"./lib/parser.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/parser.js\");\n","'use strict';\n//parse Empty Node as self closing node\nconst buildOptions = require('./util').buildOptions;\n\nconst defaultOptions = {\n attributeNamePrefix: '@_',\n attrNodeName: false,\n textNodeName: '#text',\n ignoreAttributes: true,\n cdataTagName: false,\n cdataPositionChar: '\\\\c',\n format: false,\n indentBy: ' ',\n supressEmptyNode: false,\n tagValueProcessor: function(a) {\n return a;\n },\n attrValueProcessor: function(a) {\n return a;\n },\n};\n\nconst props = [\n 'attributeNamePrefix',\n 'attrNodeName',\n 'textNodeName',\n 'ignoreAttributes',\n 'cdataTagName',\n 'cdataPositionChar',\n 'format',\n 'indentBy',\n 'supressEmptyNode',\n 'tagValueProcessor',\n 'attrValueProcessor',\n];\n\nfunction Parser(options) {\n this.options = buildOptions(options, defaultOptions, props);\n if (this.options.ignoreAttributes || this.options.attrNodeName) {\n this.isAttribute = function(/*a*/) {\n return false;\n };\n } else {\n this.attrPrefixLen = this.options.attributeNamePrefix.length;\n this.isAttribute = isAttribute;\n }\n if (this.options.cdataTagName) {\n this.isCDATA = isCDATA;\n } else {\n this.isCDATA = function(/*a*/) {\n return false;\n };\n }\n this.replaceCDATAstr = replaceCDATAstr;\n this.replaceCDATAarr = replaceCDATAarr;\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.supressEmptyNode) {\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\nParser.prototype.parse = function(jObj) {\n return this.j2x(jObj, 0).val;\n};\n\nParser.prototype.j2x = function(jObj, level) {\n let attrStr = '';\n let val = '';\n const keys = Object.keys(jObj);\n const len = keys.length;\n for (let i = 0; i < len; i++) {\n const key = keys[i];\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.attrValueProcessor('' + jObj[key]) + '\"';\n } else if (this.isCDATA(key)) {\n if (jObj[this.options.textNodeName]) {\n val += this.replaceCDATAstr(jObj[this.options.textNodeName], jObj[key]);\n } else {\n val += this.replaceCDATAstr('', jObj[key]);\n }\n } else {\n //tag value\n if (key === this.options.textNodeName) {\n if (jObj[this.options.cdataTagName]) {\n //value will added while processing cdata\n } else {\n val += this.options.tagValueProcessor('' + jObj[key]);\n }\n } else {\n val += this.buildTextNode(jObj[key], key, '', level);\n }\n }\n } else if (Array.isArray(jObj[key])) {\n //repeated nodes\n if (this.isCDATA(key)) {\n val += this.indentate(level);\n if (jObj[this.options.textNodeName]) {\n val += this.replaceCDATAarr(jObj[this.options.textNodeName], jObj[key]);\n } else {\n val += this.replaceCDATAarr('', jObj[key]);\n }\n } else {\n //nested 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 const result = this.j2x(item, level + 1);\n val += this.buildObjNode(result.val, key, result.attrStr, level);\n } else {\n val += this.buildTextNode(item, key, '', level);\n }\n }\n }\n } else {\n //nested node\n if (this.options.attrNodeName && key === this.options.attrNodeName) {\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.attrValueProcessor('' + jObj[key][Ks[j]]) + '\"';\n }\n } else {\n const result = this.j2x(jObj[key], level + 1);\n val += this.buildObjNode(result.val, key, result.attrStr, level);\n }\n }\n }\n return {attrStr: attrStr, val: val};\n};\n\nfunction replaceCDATAstr(str, cdata) {\n str = this.options.tagValueProcessor('' + str);\n if (this.options.cdataPositionChar === '' || str === '') {\n return str + '');\n }\n return str + this.newLine;\n }\n}\n\nfunction buildObjectNode(val, key, attrStr, level) {\n if (attrStr && !val.includes('<')) {\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(val) +\n ' 1) {\n jObj[tagname] = [];\n for (var tag in node.child[tagname]) {\n jObj[tagname].push(convertToJson(node.child[tagname][tag], options));\n }\n } else {\n jObj[tagname] = convertToJson(node.child[tagname][0], options);\n }\n }\n\n //add value\n return jObj;\n};\n\nexports.convertToJson = convertToJson;\n","'use strict';\n\nconst util = require('./util');\nconst buildOptions = require('./util').buildOptions;\nconst x2j = require('./xmlstr2xmlnode');\n\n//TODO: do it later\nconst convertToJsonString = function(node, options) {\n options = buildOptions(options, x2j.defaultOptions, x2j.props);\n\n options.indentBy = options.indentBy || '';\n return _cToJsonStr(node, options, 0);\n};\n\nconst _cToJsonStr = function(node, options, level) {\n let jObj = '{';\n\n //traver through all the children\n const keys = Object.keys(node.child);\n\n for (let index = 0; index < keys.length; index++) {\n var tagname = keys[index];\n if (node.child[tagname] && node.child[tagname].length > 1) {\n jObj += '\"' + tagname + '\" : [ ';\n for (var tag in node.child[tagname]) {\n jObj += _cToJsonStr(node.child[tagname][tag], options) + ' , ';\n }\n jObj = jObj.substr(0, jObj.length - 1) + ' ] '; //remove extra comma in last\n } else {\n jObj += '\"' + tagname + '\" : ' + _cToJsonStr(node.child[tagname][0], options) + ' ,';\n }\n }\n util.merge(jObj, node.attrsMap);\n //add attrsMap as new children\n if (util.isEmptyObject(jObj)) {\n return util.isExist(node.val) ? node.val : '';\n } else {\n if (util.isExist(node.val)) {\n if (!(typeof node.val === 'string' && (node.val === '' || node.val === options.cdataPositionChar))) {\n jObj += '\"' + options.textNodeName + '\" : ' + stringval(node.val);\n }\n }\n }\n //add value\n if (jObj[jObj.length - 1] === ',') {\n jObj = jObj.substr(0, jObj.length - 2);\n }\n return jObj + '}';\n};\n\nfunction stringval(v) {\n if (v === true || v === false || !isNaN(v)) {\n return v;\n } else {\n return '\"' + v + '\"';\n }\n}\n\nfunction indentate(options, level) {\n return options.indentBy.repeat(level);\n}\n\nexports.convertToJsonString = convertToJsonString;\n","'use strict';\n\nconst nodeToJson = require('./node2json');\nconst xmlToNodeobj = require('./xmlstr2xmlnode');\nconst x2xmlnode = require('./xmlstr2xmlnode');\nconst buildOptions = require('./util').buildOptions;\n\nexports.parse = function(xmlData, options) {\n options = buildOptions(options, x2xmlnode.defaultOptions, x2xmlnode.props);\n return nodeToJson.convertToJson(xmlToNodeobj.getTraversalObj(xmlData, options), options);\n};\nexports.convertTonimn = require('../src/nimndata').convert2nimn;\nexports.getTraversalObj = xmlToNodeobj.getTraversalObj;\nexports.convertToJson = nodeToJson.convertToJson;\nexports.convertToJsonString = require('./node2json_str').convertToJsonString;\nexports.validate = require('./validator').validate;\nexports.j2xParser = require('./json2xml');\nexports.parseToNimn = function(xmlData, schema, options) {\n return exports.convertTonimn(exports.getTraversalObj(xmlData, options), schema, options);\n};\n","'use strict';\n\nconst getAllMatches = function(string, regex) {\n const matches = [];\n let match = regex.exec(string);\n while (match) {\n const allmatches = [];\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 doesMatch = function(string, regex) {\n const match = regex.exec(string);\n return !(match === null || typeof match === 'undefined');\n};\n\nconst doesNotMatch = function(string, regex) {\n return !doesMatch(string, regex);\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) {\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 target[keys[i]] = a[keys[i]];\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\nexports.buildOptions = function(options, defaultOptions, props) {\n var 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.doesMatch = doesMatch;\nexports.doesNotMatch = doesNotMatch;\nexports.getAllMatches = getAllMatches;\n","'use strict';\n\nconst util = require('./util');\n\nconst defaultOptions = {\n allowBooleanAttributes: false, //A tag can have attributes without any value\n localeRange: 'a-zA-Z',\n};\n\nconst props = ['allowBooleanAttributes', 'localeRange'];\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\n const tags = [];\n let tagFound = false;\n if (xmlData[0] === '\\ufeff') {\n // check for byte order mark (BOM)\n xmlData = xmlData.substr(1);\n }\n const regxAttrName = new RegExp('^[_w][\\\\w\\\\-.:]*$'.replace('_w', '_' + options.localeRange));\n const regxTagName = new RegExp('^([w]|_)[\\\\w.\\\\-_:]*'.replace('([w', '([' + options.localeRange));\n for (let i = 0; i < xmlData.length; i++) {\n if (xmlData[i] === '<') {\n //starting of tag\n //read until you reach to '>' avoiding any '>' in attribute value\n\n i++;\n if (xmlData[i] === '?') {\n i = readPI(xmlData, ++i);\n if (i.err) {\n return i;\n }\n } else 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 (\n ;\n i < xmlData.length &&\n xmlData[i] !== '>' &&\n xmlData[i] !== ' ' &&\n xmlData[i] !== '\\t' &&\n xmlData[i] !== '\\n' &&\n xmlData[i] !== '\\r';\n 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 }\n if (!validateTagName(tagName, regxTagName)) {\n return {err: {code: 'InvalidTag', msg: 'Tag ' + tagName + ' is an invalid name.'}};\n }\n\n const result = readAttributeStr(xmlData, i);\n if (result === false) {\n return {err: {code: 'InvalidAttr', msg: 'Attributes for \"' + tagName + '\" have open quote.'}};\n }\n let attrStr = result.value;\n i = result.index;\n\n if (attrStr[attrStr.length - 1] === '/') {\n //self closing tag\n attrStr = attrStr.substring(0, attrStr.length - 1);\n const isValid = validateAttributeString(attrStr, options, regxAttrName);\n if (isValid === true) {\n tagFound = true;\n //continue; //text may presents after self closing tag\n } else {\n return isValid;\n }\n } else if (closingTag) {\n if(!result.tagClosed){\n return {\n err: {code: 'InvalidTag', msg: 'closing tag \"' + tagName + \"\\\" don't have proper closing.\"},\n };\n }else if (attrStr.trim().length > 0) {\n return {\n err: {code: 'InvalidTag', msg: 'closing tag \"' + tagName + \"\\\" can't have attributes or invalid starting.\"},\n };\n } else {\n const otg = tags.pop();\n if (tagName !== otg) {\n return {\n err: {code: 'InvalidTag', msg: 'closing tag ' + otg + ' is expected inplace of ' + tagName + '.'},\n };\n }\n }\n } else {\n const isValid = validateAttributeString(attrStr, options, regxAttrName);\n if (isValid !== true) {\n return isValid;\n }\n tags.push(tagName);\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 {\n break;\n }\n }\n } //end of reading tag text value\n if (xmlData[i] === '<') {\n i--;\n }\n }\n } else {\n if (xmlData[i] === ' ' || xmlData[i] === '\\t' || xmlData[i] === '\\n' || xmlData[i] === '\\r') {\n continue;\n }\n return {err: {code: 'InvalidChar', msg: 'char ' + xmlData[i] + ' is not expected .'}};\n }\n }\n\n if (!tagFound) {\n return {err: {code: 'InvalidXml', msg: 'Start tag expected.'}};\n } else if (tags.length > 0) {\n return {\n err: {code: 'InvalidXml', msg: 'Invalid ' + JSON.stringify(tags, null, 4).replace(/\\r?\\n/g, '') + ' found.'},\n };\n }\n\n return true;\n};\n\n/**\n * Read Processing insstructions and skip\n * @param {*} xmlData\n * @param {*} i\n */\nfunction readPI(xmlData, i) {\n var start = i;\n for (; i < xmlData.length; i++) {\n if (xmlData[i] == '?' || xmlData[i] == ' ') {\n //tagname\n var tagname = xmlData.substr(start, i - start);\n if (i > 5 && tagname === 'xml') {\n return {err: {code: 'InvalidXml', msg: 'XML declaration allowed only at the start of the document.'}};\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\nvar doubleQuote = '\"';\nvar 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 continue;\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 {value: attrStr, index: i, tagClosed: tagClosed};\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, regxAttrName) {\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 //console.log(matches[i]);\n\n if (matches[i][1].length === 0) {\n //nospace before attribute name: a=\"sd\"b=\"saf\"\n return {err: {code: 'InvalidAttr', msg: 'attribute ' + matches[i][2] + ' has no space in starting.'}};\n } else if (matches[i][3] === undefined && !options.allowBooleanAttributes) {\n //independent attribute: ab\n return {err: {code: 'InvalidAttr', msg: 'boolean attribute ' + matches[i][2] + ' is not allowed.'}};\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, regxAttrName)) {\n return {err: {code: 'InvalidAttr', msg: 'attribute ' + attrName + ' is an invalid name.'}};\n }\n if (!attrNames.hasOwnProperty(attrName)) {\n //check for duplicate attribute.\n attrNames[attrName] = 1;\n } else {\n return {err: {code: 'InvalidAttr', msg: 'attribute ' + attrName + ' is repeated.'}};\n }\n }\n\n return true;\n}\n\n// const validAttrRegxp = /^[_a-zA-Z][\\w\\-.:]*$/;\n\nfunction validateAttrName(attrName, regxAttrName) {\n // const validAttrRegxp = new RegExp(regxAttrName);\n return util.doesMatch(attrName, regxAttrName);\n}\n\n//const startsWithXML = new RegExp(\"^[Xx][Mm][Ll]\");\n// startsWith = /^([a-zA-Z]|_)[\\w.\\-_:]*/;\n\nfunction validateTagName(tagname, regxTagName) {\n /*if(util.doesMatch(tagname,startsWithXML)) return false;\n else*/\n return !util.doesNotMatch(tagname, regxTagName);\n}\n","'use strict';\n\nmodule.exports = function(tagname, parent, val) {\n this.tagname = tagname;\n this.parent = parent;\n this.child = {}; //child tags\n this.attrsMap = {}; //attributes map\n this.val = val; //text only\n this.addChild = function(child) {\n if (Array.isArray(this.child[child.tagname])) {\n //already presents\n this.child[child.tagname].push(child);\n } else {\n this.child[child.tagname] = [child];\n }\n };\n};\n","'use strict';\n\nconst util = require('./util');\nconst buildOptions = require('./util').buildOptions;\nconst xmlNode = require('./xmlNode');\nconst TagType = {OPENING: 1, CLOSING: 2, SELF: 3, CDATA: 4};\nlet regx =\n '<((!\\\\[CDATA\\\\[([\\\\s\\\\S]*?)(]]>))|(([\\\\w:\\\\-._]*:)?([\\\\w:\\\\-._]+))([^>]*)>|((\\\\/)(([\\\\w:\\\\-._]*:)?([\\\\w:\\\\-._]+))\\\\s*>))([^<]*)';\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\nconst defaultOptions = {\n attributeNamePrefix: '@_',\n attrNodeName: false,\n textNodeName: '#text',\n ignoreAttributes: true,\n ignoreNameSpace: false,\n allowBooleanAttributes: false, //a tag can have attributes without any value\n //ignoreRootElement : false,\n parseNodeValue: true,\n parseAttributeValue: false,\n arrayMode: false,\n trimValues: true, //Trim string values of tag and attributes\n cdataTagName: false,\n cdataPositionChar: '\\\\c',\n localeRange: '',\n tagValueProcessor: function(a) {\n return a;\n },\n attrValueProcessor: function(a) {\n return a;\n },\n stopNodes: []\n //decodeStrict: false,\n};\n\nexports.defaultOptions = defaultOptions;\n\nconst props = [\n 'attributeNamePrefix',\n 'attrNodeName',\n 'textNodeName',\n 'ignoreAttributes',\n 'ignoreNameSpace',\n 'allowBooleanAttributes',\n 'parseNodeValue',\n 'parseAttributeValue',\n 'arrayMode',\n 'trimValues',\n 'cdataTagName',\n 'cdataPositionChar',\n 'localeRange',\n 'tagValueProcessor',\n 'attrValueProcessor',\n 'parseTrueNumberOnly',\n 'stopNodes'\n];\nexports.props = props;\n\nconst getTraversalObj = function(xmlData, options) {\n options = buildOptions(options, defaultOptions, props);\n //xmlData = xmlData.replace(/\\r?\\n/g, \" \");//make it single line\n xmlData = xmlData.replace(//g, ''); //Remove comments\n\n const xmlObj = new xmlNode('!xml');\n let currentNode = xmlObj;\n\n regx = regx.replace(/\\[\\\\w/g, '[' + options.localeRange + '\\\\w');\n const tagsRegx = new RegExp(regx, 'g');\n let tag = tagsRegx.exec(xmlData);\n let nextTag = tagsRegx.exec(xmlData);\n while (tag) {\n const tagType = checkForTagType(tag);\n\n if (tagType === TagType.CLOSING) {\n //add parsed data to parent node\n if (currentNode.parent && tag[14]) {\n currentNode.parent.val = util.getValue(currentNode.parent.val) + '' + processTagValue(tag[14], options);\n }\n if (options.stopNodes.length && options.stopNodes.includes(currentNode.tagname)) {\n currentNode.child = []\n if (currentNode.attrsMap == undefined) { currentNode.attrsMap = {}}\n currentNode.val = xmlData.substr(currentNode.startIndex + 1, tag.index - currentNode.startIndex - 1)\n }\n currentNode = currentNode.parent;\n } else if (tagType === TagType.CDATA) {\n if (options.cdataTagName) {\n //add cdata node\n const childNode = new xmlNode(options.cdataTagName, currentNode, tag[3]);\n childNode.attrsMap = buildAttributesMap(tag[8], options);\n currentNode.addChild(childNode);\n //for backtracking\n currentNode.val = util.getValue(currentNode.val) + options.cdataPositionChar;\n //add rest value to parent node\n if (tag[14]) {\n currentNode.val += processTagValue(tag[14], options);\n }\n } else {\n currentNode.val = (currentNode.val || '') + (tag[3] || '') + processTagValue(tag[14], options);\n }\n } else if (tagType === TagType.SELF) {\n if (currentNode && tag[14]) {\n currentNode.val = util.getValue(currentNode.val) + '' + processTagValue(tag[14], options);\n }\n\n const childNode = new xmlNode(options.ignoreNameSpace ? tag[7] : tag[5], currentNode, '');\n if (tag[8] && tag[8].length > 0) {\n tag[8] = tag[8].substr(0, tag[8].length - 1);\n }\n childNode.attrsMap = buildAttributesMap(tag[8], options);\n currentNode.addChild(childNode);\n } else {\n //TagType.OPENING\n const childNode = new xmlNode(\n options.ignoreNameSpace ? tag[7] : tag[5],\n currentNode,\n processTagValue(tag[14], options)\n );\n if (options.stopNodes.length && options.stopNodes.includes(childNode.tagname)) {\n childNode.startIndex=tag.index + tag[1].length\n }\n childNode.attrsMap = buildAttributesMap(tag[8], options);\n currentNode.addChild(childNode);\n currentNode = childNode;\n }\n\n tag = nextTag;\n nextTag = tagsRegx.exec(xmlData);\n }\n\n return xmlObj;\n};\n\nfunction processTagValue(val, options) {\n if (val) {\n if (options.trimValues) {\n val = val.trim();\n }\n val = options.tagValueProcessor(val);\n val = parseValue(val, options.parseNodeValue, options.parseTrueNumberOnly);\n }\n\n return val;\n}\n\nfunction checkForTagType(match) {\n if (match[4] === ']]>') {\n return TagType.CDATA;\n } else if (match[10] === '/') {\n return TagType.CLOSING;\n } else if (typeof match[8] !== 'undefined' && match[8].substr(match[8].length - 1) === '/') {\n return TagType.SELF;\n } else {\n return TagType.OPENING;\n }\n}\n\nfunction resolveNameSpace(tagname, options) {\n if (options.ignoreNameSpace) {\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, parseTrueNumberOnly) {\n if (shouldParse && typeof val === 'string') {\n let parsed;\n if (val.trim() === '' || isNaN(val)) {\n parsed = val === 'true' ? true : val === 'false' ? false : val;\n } else {\n if (val.indexOf('0x') !== -1) {\n //support hexa decimal\n parsed = Number.parseInt(val, 16);\n } else if (val.indexOf('.') !== -1) {\n parsed = Number.parseFloat(val);\n } else {\n parsed = Number.parseInt(val, 10);\n }\n if (parseTrueNumberOnly) {\n parsed = String(parsed) === val ? parsed : val;\n }\n }\n return parsed;\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*([\\'\"])(.*?)\\\\3)?', 'g');\n\nfunction buildAttributesMap(attrStr, 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 if (attrName.length) {\n if (matches[i][4] !== undefined) {\n if (options.trimValues) {\n matches[i][4] = matches[i][4].trim();\n }\n matches[i][4] = options.attrValueProcessor(matches[i][4]);\n attrs[options.attributeNamePrefix + attrName] = parseValue(\n matches[i][4],\n options.parseAttributeValue,\n options.parseTrueNumberOnly\n );\n } else if (options.allowBooleanAttributes) {\n attrs[options.attributeNamePrefix + attrName] = true;\n }\n }\n }\n if (!Object.keys(attrs).length) {\n return;\n }\n if (options.attrNodeName) {\n const attrCollection = {};\n attrCollection[options.attrNodeName] = attrs;\n return attrCollection;\n }\n return attrs;\n }\n}\n\nexports.getTraversalObj = getTraversalObj;\n"],"sourceRoot":""}