var CT_ODS = "application/vnd.oasis.opendocument.spreadsheet";
function parse_manifest(d, opts) {
var str = xlml_normalize(d);
var Rn;
var FEtag;
while (Rn = xlmlregex.exec(str))
switch (Rn[3]) {
case "manifest":
break;
case "file-entry":
FEtag = parsexmltag(Rn[0], false);
if (FEtag.path == "/" && FEtag.type !== CT_ODS)
throw new Error("This OpenDocument is not a spreadsheet");
break;
case "encryption-data":
case "algorithm":
case "start-key-generation":
case "key-derivation":
throw new Error("Unsupported ODS Encryption");
default:
if (opts && opts.WTF)
throw Rn;
}
}
function write_manifest(manifest) {
var o = [XML_HEADER];
o.push('\n');
o.push(' \n');
for (var i = 0; i < manifest.length; ++i)
o.push(' \n');
o.push("");
return o.join("");
}
function write_rdf_type(file, res, tag) {
return [
' \n',
' \n',
" \n"
].join("");
}
function write_rdf_has(base, file) {
return [
' \n',
' \n',
" \n"
].join("");
}
function write_rdf(rdf) {
var o = [XML_HEADER];
o.push('\n');
for (var i = 0; i != rdf.length; ++i) {
o.push(write_rdf_type(rdf[i][0], rdf[i][1]));
o.push(write_rdf_has("", rdf[i][0]));
}
o.push(write_rdf_type("", "Document", "pkg"));
o.push("");
return o.join("");
}
function write_meta_ods(wb, opts) {
return 'SheetJS ' + XLSX.version + "";
}