Dear Gitlab Users, for our upcoming upgrade to Gitlab v14, Gitlab will be unavailable on Thursday, 05.08.2021 from 5:00 pm to approximately 7:00 pm. Note that with v14, certain breaking changes will be introduced (https://about.gitlab.com/blog/2021/06/04/gitlab-moving-to-14-breaking-changes/).

Commit bb92c94d authored by jerome's avatar jerome
Browse files

path to image for pages

parent fa73fbdc
......@@ -53,7 +53,8 @@ Refer to comments in the code to understand the used algorithm.
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:saxon="http://saxon.sf.net/" exclude-result-prefixes="gfl saxon xs"
xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
xmlns:marc="http://www.loc.gov/MARC21/slim">
xmlns:marc="http://www.loc.gov/MARC21/slim"
xmlns:img="http://whatever">
<xsl:output method="xml" indent="yes" saxon:suppress-indentation="div" />
<xsl:strip-space elements="*" />
......@@ -595,6 +596,12 @@ Refer to comments in the code to understand the used algorithm.
<!-- %%%%%%%%%%%%% page splitting and HTML generating %%%%%%%%%%%%%%%%%%%%%%% -->
<!-- returns the image path for page-->
<xsl:function name="img:get_path" as="xs:string">
<xsl:param name="image_id"/>
<xsl:param name="context"/>
<xsl:value-of select="$context/preceding-sibling::facsimile/graphic[@xml:id=$image_id]/@url"/>
</xsl:function>
<!-- Here we start the page splitting algorithm.
In general, it groups all elements between two <pb/>'s and creates one page for each such group.
......@@ -609,6 +616,7 @@ Refer to comments in the code to understand the used algorithm.
<xsl:if test="self::pb">
<doc>
<xsl:variable name="pageNumber" select="count(preceding::pb) + 1" />
<field name="id">
<xsl:value-of select="$context/@xml:id" />
<xsl:text>_page</xsl:text>
......@@ -644,11 +652,17 @@ Refer to comments in the code to understand the used algorithm.
<xsl:value-of select="." />
</field>
</xsl:for-each>
<xsl:variable name="image_id" select="./@facs"/>
<xsl:if test="./@facs">
<field name="image_id">
<xsl:value-of select="./@facs"/>
<xsl:value-of select="$image_id"/>
</field>
</xsl:if>
<!-- give me image contains var id -->
<xsl:variable name="clean_image_id" select="substring($image_id, 2)"/>
<field name="image_urls">
<xsl:value-of select="img:get_path($clean_image_id, $context)"/>
</field>
</xsl:if>
</doc>
</xsl:if>
</xsl:for-each-group>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment