MegaArman / toscanini

A JavaScript module for searching music scores.
https://megaarman.github.io/toscanini
MIT License
16 stars 3 forks source link

Is the Current XML Parser worth it? #43

Closed MegaArman closed 7 years ago

MegaArman commented 7 years ago

xml2js has pros and cons...

Pros: -searching a JSO representation of a score is fairly quick (though the conversion itself takes some time) -code is pretty clean - no APIs or libraries needed to traverse JSO

Cons: -Because the JSO aims to be efficient, things can get more complex to parse. For example, if an instrument plays multiple notes in a measure, the notes will be combined into an array. If explicitArray:true, then it will always be an array, but this complicates queries related to other tags. -If one wants to analyze chords and such, it is not possible with the current parser. Chords require analysis of specific ordering of tags of xml which gets lost in JSON it seems???? I don't remember.

Perhaps preserveChildrenOrder can help???

Alternatives: -XML Dom Parser -XML->JSON parser that respects ordering of tags -XML Sax parser -probably a bad idea

MegaArman commented 7 years ago

6/23/17 WE LIKE NODE-ELEMENTTREE

We tried ... xmldom, xmldoc, XPath: seem to respect order but are ugly /complex to use xml2js: does not respect sibling order because JSON LibXML: does not build on Fedora 25<- boooo