FrankensteinVariorum / TAN-2021

TAN version 2021: customization experiment for the Frankenstein Variorum Project
Other
0 stars 0 forks source link

Diff+ XSLT HTML-output: file resolution to JS #1

Open ebeshero opened 2 years ago

ebeshero commented 2 years ago

@Arithmeticus Happy to report that JS for the Venns is now working for me, but there's an odd XSLT issue. $resolved-uri-to-diff-css points without issue to my saved output (tucked inside /applications), but none of the JS variables do. I've remedied it with a simple patch that works for me, but I'm not sure why the other variables don't succeed in resolving the way the CSS does.

My patch (works for me / highlights the problem variables):

 <xsl:variable name="resolved-uri-to-diff-css" as="xs:string"
        select="($resolved-uri-to-css-dir || 'diff.css')"/> 
<!-- ebb: The CSS variable is fine. -->
    <xsl:variable name="resolved-uri-to-TAN-js" as="xs:string"
        select="('../../' || $resolved-uri-to-js-dir || 'tan2020.js')"/>
    <xsl:variable name="resolved-uri-to-diff-js" as="xs:string"
        select="('../../' || $resolved-uri-to-js-dir || 'diff.js')"/>
    <xsl:variable name="resolved-uri-to-jquery" as="xs:string"
        select="('../../' || $resolved-uri-to-js-dir || 'jquery.js')"/>
    <xsl:variable name="resolved-uri-to-venn-js" as="xs:string"
        select="('../../' || $resolved-uri-to-js-dir || 'venn.js/venn.js')"/>
ebeshero commented 2 years ago

And that hack didn't actually work. Here are the relevant output lines in the HTML:

 <link rel="stylesheet" href="../../../output/css/diff.css" type="text/css"><!----></link>
        <script src="../../file:/Users/eeb4/Documents/GitHub/fv/TAN-2021/applications/Diff+/output/js/jquery.js"><!----></script>
        <script src="https://d3js.org/d3.v5.min.js"><!----></script>
        <script src="../../file:/Users/eeb4/Documents/GitHub/fv/TAN-2021/applications/Diff+/output/js/venn.js/venn.js"><!----></script>

The filepath gets interpreted as absolute by the JS parameters.

ebeshero commented 2 years ago

(Fixed for myself by plugging in a literal relative filepath to bypass the js parameters.)

Arithmeticus commented 2 years ago

Hi @ebeshero , I think the problem here is that your patch tried to prepend a relative path to an absolute one.

Have you tried adjusting the global parametr $output-javascript-library-directory-uri?