cf-convention / vocabularies

Issues and source files for CF controlled vocabularies
3 stars 1 forks source link

Reference XLST from the standard name XML #231

Open DocOtak opened 3 weeks ago

DocOtak commented 3 weeks ago

As an experiment in space/processing savings and since every browser supports XLM stylesheets. I tried referencing the XML style sheet from the standard name XML and letting the browser make the html name table itself. I needed to update the stylesheet a little since it was not producing very valid HTML, divs in the head block, a paragraph element in the table, etc... I also added some javascript to do the link processing (what the python script does). I found that this works quite well. Adopting the style sheet reference and letting the browsers do their thing could simplify the standard name publishing to be only making a new XML and none of the other steps. We would save a significant amount of space not having the preprocessed standard name html tables in github.

The following line was added to the standard name XML to do this:

<?xml-stylesheet type="text/xsl" href="cf-standard-name-table-1.3.xsl" ?>

For my own convenience, I reused the KWIC repository on my own github account for this experiment.

Here is the example on my own site: https://www.andrewbarna.org/cf_kwic/cf-standard-name-table.xml For the HTML links you just link to the XML:

<a href="https://www.andrewbarna.org/cf_kwic/cf-standard-name-table.xml">HTML</a>

To download the XML you would make the a tags have a download attribute:

<a href="https://www.andrewbarna.org/cf_kwic/cf-standard-name-table.xml" download>XML</a>

Github strips that attribute in these issues so I cannot show a demo.

Like the KWIC indexer example I made, we could put a "download HTML" link/button in that generated template so the people can actually download the generated HTML for offline use.

JonathanGregory commented 3 weeks ago

Dear Barna @DocOtak

That's a very good idea, which saves redundancy and space. It's remarkable to see, and it's pretty fast, but slower than loading the ready-made HTML. Would it be faster on the GitHub site, do you think? If it's bound to be discernibly slower, perhaps we ought to keep the current HTML only as such, since that's looked at much more often than all the old versions, for which we could use this on-the-fly method.

Best wishes

Jonathan

larsbarring commented 2 weeks ago

As you are looking at the XSLT file you might want to have a look at cf-convention.github.io/#471, and perhaps also at cf-convention.github.io/issues/186 although the latter is more on text content than technical aspects.