mrgreekgeek / abbott-smith-greek-lexicon-online

A little JS app to make Abbott-Smith searchable and usable with a focus on good UI and UX
https://lexicon.mrgreekgeek.com
MIT No Attribution
2 stars 0 forks source link

Remove unnecessary "namespace" URLS from JSON output #5

Closed mrgreekgeek closed 9 months ago

mrgreekgeek commented 9 months ago

@welcome-me,
AbbotSmithData.js has 24,340 occurrences of this URL: http://www.crosswire.org/2013/TEIOSIS/namespace That might be good info to have in the XML file, but it's not needed in JSON, so what's the best way to get rid of it? Interestingly, the original XML file only has it a few times, so it's getting added in somehow.

welcome-me commented 9 months ago

It looks like it is automatically added by the DomParser in lexicon-to-json.js to keep the XML valid (ie. by specifying the XML schema used by the document and/or namespacing the XML). The three suggestions I have to fix it are:

  1. Delete the namespace data from the .XML file, or
  2. Programmatically delete the xmlns attributes in encode-lexicon.js before it encodes it to JSON. (This is more complicated, but would keep our source data intact.)
  3. Tell DomParser to parse the data as HTML. (I don't know if this would work, but it might be an easy solution.)

After doing one of those steps, the lexicon would need re-generated, and tested that it works.

Cheers for space savings!