Skip to content

Commit

Permalink
Merge pull request #422 from Edirom/fix/graphics-siblingDirs
Browse files Browse the repository at this point in the history
capture http graphics URLs instead of folder-ups
  • Loading branch information
bwbohl authored Sep 11, 2024
2 parents d3f4ce4 + ce2e688 commit abc9867
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions add/data/xslt/tei/profiles/edirom-body/teiBody2HTML.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
<xsl:with-param name="implicitBlock" select="$implicitBlock"/>
</xsl:next-match>
-->
<doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
<desc>Section-like object</desc>
</doc>
<xd:doc>
<xd:desc>Section-like object</xd:desc>
</xd:doc>
<xsl:template name="makeSection">
<xsl:param name="element"/>
<xsl:param name="level"/>
Expand Down Expand Up @@ -148,11 +148,23 @@
</xsl:otherwise>
</xsl:choose>
-->
<xsl:variable name="graphicsPrefix">

<!--
The variable `$graphicsPrefix` is to distinguish images (referenced from a TEI file) that are
a) to be fetched from a remote location (via http or https) or
b) from the current EOL instance
In the case of a) `$graphicsPrefix` will be the empty-sequence
In the case of b) `$graphicsPrefix` will hold a string with the computed URL of the image
-->
<xsl:variable name="graphicsPrefix" as="xs:string?">
<xsl:choose>
<xsl:when test="starts-with(@url, '../')">
<xsl:value-of select="$contextPath || '/' || substring-after(functx:substring-before-last($docUri, '/'), 'xmldb:exist:///db/') || '/'"/>
<xsl:when test="starts-with(@url, 'http')">
<!-- url starts with http i.e. points to a web accessible location -->
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$contextPath || '/' || substring-after(functx:substring-before-last($docUri, '/'), 'xmldb:exist:///db/') || '/'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- /Edirom Online specific cutomization -->
Expand Down

0 comments on commit abc9867

Please sign in to comment.