Skip to content

Commit

Permalink
Merge pull request #16 from jamiefaye/dev
Browse files Browse the repository at this point in the history
Attempt to fix Leonard's problem
  • Loading branch information
jamiefaye authored Jul 15, 2018
2 parents 57165a2 + c36b54d commit df89158
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions xmlView/src/viewXML.js
Original file line number Diff line number Diff line change
Expand Up @@ -1289,26 +1289,29 @@ class DelugeDoc {
this.earliestCompatibleFirmware='';
}

// let str = this.firmwareVersionFound + "\n" + this.earliestCompatibleFirmware + "\n";
// alert(str);

this.newNoteFormat = !(this.firmwareVersionFound.indexOf('1.2') >= 0 || this.firmwareVersionFound.indexOf('1.3') >= 0);
this.newSynthNames = !!this.earliestCompatibleFirmware;
// get rid of invalid XML elements using string search, so as to work-around
// Leonard's issue:
let seek = "</earliestCompatibleFirmware>\n";
let sx = text.indexOf(seek);
if (sx < 0) {
seek = "</firmwareVersion>\n";
sx = text.indexOf(seek);
}
let fixedText;
if (sx >= 0) {
fixedText = text.substring(sx + seek.length);
} else {
fixedText = text;

// Skip past the illegal elements at the front of the file
// We stop when we see a <k or a <s
let inx = 0;
let eofx = text.length - 1;
while (inx < eofx) {
if (text[inx] === '<') {
let c = text[inx + 1];
if (c === 's' || c === 'k') break;
}
inx++;
}
let fixedText = '<?xml version="1.0" encoding="UTF-8"?>\n' + text.substring(inx);

// let firstFixed = fixedText.substring(0, 160);
// alert (firstFixed);


// let fixedText0 = text.replace(/<firmwareVersion>.*<.firmwareVersion>/i,"");
// let fixedText = fixedText0.replace(/<earliestCompatibleFirmware>.*<.earliestCompatibleFirmware>/i,"");
var asDOM = getXmlDOMFromString(fixedText);
// Uncomment following to generate ordering table based on a real-world example.
// enOrderTab(asDOM);
Expand Down

0 comments on commit df89158

Please sign in to comment.