I now have the variant spellings being automatically harvested into the HTML output for location documents, and the result is functioning correctly with and without JavaScript. I'm now in the process of rewriting the code for generation of the gazetteer pages themselves so that instead of figuring out its own set of variants, it simply harvests from the spelling_variants.xml file which is created already. Once that's working, the existing appendix code should take care of pulling in the variant spellings when generating the HTML.