/* 9.3.2 OPC Relationships Markup */ var RELS = ({ WB: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", SHEET: "http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument" }/*:any*/); function parse_rels(data/*:?string*/, currentFilePath/*:string*/) { if (!data) return data; if (currentFilePath.charAt(0) !== '/') { currentFilePath = '/'+currentFilePath; } var rels = {}; var hash = {}; var resolveRelativePathIntoAbsolute = function (to) { var toksFrom = currentFilePath.split('/'); toksFrom.pop(); // folder path var toksTo = to.split('/'); var reversed = []; while (toksTo.length !== 0) { var tokTo = toksTo.shift(); if (tokTo === '..') { toksFrom.pop(); } else if (tokTo !== '.') { toksFrom.push(tokTo); } } return toksFrom.join('/'); }; (data.match(tagregex)||[]).forEach(function(x) { var y = parsexmltag(x); /* 9.3.2.2 OPC_Relationships */ if (y[0] === '2){ o[o.length] = (''); o[1]=o[1].replace("/>",">"); } return o.join(""); }