Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ebeshero opened this issue Apr 23, 2022 · 3 comments
Open

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

ebeshero opened this issue Apr 23, 2022 · 3 comments

Comments

@ebeshero
Copy link
Member

ebeshero commented Apr 23, 2022

@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
Copy link
Member Author

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
Copy link
Member Author

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

@Arithmeticus
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants