Skip to content

Commit

Permalink
Update and whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
kthoden committed Aug 31, 2021
1 parent dda70ac commit a717901
Show file tree
Hide file tree
Showing 12 changed files with 2,301 additions and 2,407 deletions.
184 changes: 86 additions & 98 deletions src/stylesheets/tei2html/tei2html.xsl
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,105 +1,93 @@
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:tei="http://www.tei-c.org/ns/1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:eoa="http://www.edition-open-access.de/ns"
exclude-result-prefixes="xs tei eoa"
version="2.0"
>
<xsl:output
method="html"
encoding="UTF-8"
indent="yes"
/>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:eoa="http://www.edition-open-access.de/ns" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs tei eoa" version="2.0">
<xsl:output method="html" encoding="UTF-8" indent="yes"/>

<xsl:include href="tei2html_publ_frontpage_utils.xsl"/>
<xsl:include href="tei2html_chapter_utils.xsl"/>
<xsl:include href="utils/html_container.xsl"/>
<xsl:include href="utils/html_inline.xsl"/>
<xsl:include href="utils/common.xsl"/>
<xsl:include href="utils/print.xsl"/>
<xsl:include href="utils/render.xsl"/>
<xsl:include href="utils/numbering.xsl"/>
<xsl:include href="utils/index.xsl"/>
<xsl:include href="tei2html_publ_frontpage_utils.xsl"/>
<xsl:include href="tei2html_chapter_utils.xsl"/>
<xsl:include href="utils/html_container.xsl"/>
<xsl:include href="utils/html_inline.xsl"/>
<xsl:include href="utils/common.xsl"/>
<xsl:include href="utils/print.xsl"/>
<xsl:include href="utils/render.xsl"/>
<xsl:include href="utils/numbering.xsl"/>
<xsl:include href="utils/index.xsl"/>

<xsl:param name="output_dir" as="xs:string" select="'./output'"/>
<xsl:param name="webdesign_url" as="xs:string" select="'/static/webdesign_platform'"/>
<xsl:param name="publ_static_url" as="xs:string" select="'/static/publications'"/>
<xsl:param name="intermediate_dir" as="xs:string?" select="eoa:conc_path($output_dir, 'intermediate')"/>
<xsl:param name="nav_items" as="element(eoa:entry)*">
<eoa:entry active="1">
<eoa:link>
<xsl:text>#</xsl:text>
</eoa:link>
<eoa:title>Publications</eoa:title>
</eoa:entry>
</xsl:param>
<xsl:param name="platform_name" as="xs:string" select="'dummy-platform'"/>
<xsl:param name="platform_uri" as="xs:string" select="'http://dummy-platform.com'"/>
<xsl:param name="aux_uri" as="xs:string" select="'../../../data/aux'"/>

<!--
<xsl:param name="verbosity" as="xs:integer" required="no" select="0"/>
-->
<xsl:param name="output_dir" as="xs:string" select="'./output'"/>
<xsl:param name="webdesign_url" as="xs:string" select="'/static/webdesign_platform'"/>
<xsl:param name="publ_static_url" as="xs:string" select="'/static/publications'"/>
<xsl:param name="intermediate_dir" as="xs:string?" select="eoa:conc_path($output_dir, 'intermediate')"/>
<xsl:param name="nav_items" as="element(eoa:entry)*">
<eoa:entry active="1">
<eoa:link>
<xsl:text>#</xsl:text>
</eoa:link>
<eoa:title>Publications</eoa:title>
</eoa:entry>
</xsl:param>
<xsl:param name="platform_name" as="xs:string" select="'dummy-platform'"/>
<xsl:param name="platform_uri" as="xs:string" select="'http://dummy-platform.com'"/>
<xsl:param name="aux_uri" as="xs:string" select="'../../../aux'"/>
<xsl:param name="index_html" as="xs:boolean" select="true()"/>
<!--
<xsl:param name="verbosity" as="xs:integer" required="no" select="0"/>
-->

<xsl:template match="/">
<xsl:sequence select="eoa:info(concat('platform name: ', $platform_name))"/>
<xsl:sequence select="eoa:info(concat('platform uri: ', $platform_uri))"/>
<xsl:variable name="output_subdir" as="xs:string">
<xsl:value-of select="eoa:conc_path3($output_dir, $series, $publication_number)"/>
</xsl:variable>
<xsl:variable name="indices" as="element(eoa:index)*">
<xsl:variable name="ctxt" select="."/>
<xsl:for-each select="$index_types">
<xsl:variable name="index_type" as="xs:string" select="."/>
<xsl:for-each select="$ctxt">
<xsl:call-template name="create_index">
<xsl:with-param name="indextype" select="$index_type"/>
</xsl:call-template>
</xsl:for-each>
</xsl:for-each>
</xsl:variable>
<xsl:if test="$intermediate_dir">
<xsl:result-document
method="xml"
encoding="UTF-8"
indent="yes"
href="{eoa:conc_path($intermediate_dir, 'indices.xml')}"
>
<xsl:copy-of select="$indices"/>
</xsl:result-document>
</xsl:if>
<xsl:result-document
method="html"
encoding="UTF-8"
include-content-type="yes"
indent="yes"
href="{eoa:conc_path($output_subdir, 'index.html')}"
>
<xsl:call-template name="render_publication_frontpage">
<xsl:with-param name="webdesign_url" select="eoa:conc_path('../..', $webdesign_url)"/>
<xsl:with-param name="publ_static_url" as="xs:string" select="eoa:conc_path( '../..', $publ_static_url)"/>
<xsl:with-param name="nav_items" as="element(eoa:entry)*" select="$nav_items"/>
<xsl:with-param name="indices" as="element(eoa:index)*" select="$indices"/>
</xsl:call-template>
</xsl:result-document>
<xsl:for-each select="//tei:div[@type='chapter']">
<xsl:result-document
method="html"
encoding="UTF-8"
include-content-type="yes"
indent="yes"
href="{eoa:conc_path3($output_subdir, xs:string(position()), 'index.html')}"
>
<xsl:call-template name="render_chapter">
<xsl:with-param name="webdesign_url" select="eoa:conc_path('../../..', $webdesign_url)"/>
<xsl:with-param name="publ_static_url" as="xs:string" select="eoa:conc_path( '../../..', $publ_static_url)"/>
<xsl:with-param name="nav_items" as="element(eoa:entry)*" select="$nav_items"/>
<xsl:with-param name="indices" as="element(eoa:index)*" select="$indices"/>
</xsl:call-template>
</xsl:result-document>
</xsl:for-each>
<xsl:sequence select="eoa:info(concat('platform name: ', $platform_name))"/>
<xsl:sequence select="eoa:info(concat('platform uri: ', $platform_uri))"/>
<xsl:variable name="output_subdir" as="xs:string">
<xsl:value-of select="eoa:conc_path3($output_dir, $series, $publication_number)"/>
</xsl:variable>
<xsl:variable name="indices" as="element(eoa:index)*">
<xsl:variable name="ctxt" select="."/>
<xsl:for-each select="$index_types">
<xsl:variable name="index_type" as="xs:string" select="."/>
<xsl:for-each select="$ctxt">
<xsl:call-template name="create_index">
<xsl:with-param name="indextype" select="$index_type"/>
</xsl:call-template>
</xsl:for-each>
</xsl:for-each>
</xsl:variable>
<xsl:if test="$intermediate_dir">
<xsl:result-document method="xml" encoding="UTF-8" indent="yes" href="{eoa:conc_path($intermediate_dir, 'indices.xml')}">
<xsl:copy-of select="$indices"/>
</xsl:result-document>
</xsl:if>
<xsl:result-document method="html" encoding="UTF-8" include-content-type="yes" indent="yes" href="{eoa:conc_path($output_subdir, 'index.html')}">
<xsl:variable name="webpath2">
<xsl:choose>
<xsl:when test="starts-with($webdesign_url, 'http')"/>
<xsl:otherwise>../..</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="render_publication_frontpage">
<xsl:with-param name="webdesign_url" select="eoa:conc_path($webpath2, $webdesign_url)"/>
<xsl:with-param name="publ_static_url" as="xs:string" select="eoa:conc_path($webpath2, $publ_static_url)"/>
<xsl:with-param name="nav_items" as="element(eoa:entry)*" select="$nav_items"/>
<xsl:with-param name="indices" as="element(eoa:index)*" select="$indices"/>
<xsl:with-param name="index_html" as="xs:boolean" select="$index_html"/>

</xsl:call-template>
</xsl:result-document>
<xsl:for-each select="//tei:div[@type='chapter']">
<xsl:variable name="webpath3">
<xsl:choose>
<xsl:when test="starts-with($webdesign_url, 'http')"/>
<xsl:otherwise>../../..</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:result-document method="html" encoding="UTF-8" include-content-type="yes" indent="yes" href="{eoa:conc_path3($output_subdir, xs:string(position()), 'index.html')}">
<xsl:call-template name="render_chapter">
<xsl:with-param name="webdesign_url" select="eoa:conc_path($webpath3, $webdesign_url)"/>
<xsl:with-param name="publ_static_url" as="xs:string" select="eoa:conc_path($webpath3, $publ_static_url)"/>
<xsl:with-param name="nav_items" as="element(eoa:entry)*" select="$nav_items"/>
<xsl:with-param name="indices" as="element(eoa:index)*" select="$indices"/>
<xsl:with-param name="index_html" as="xs:boolean" select="$index_html"/>

</xsl:call-template>
</xsl:result-document>
</xsl:for-each>
</xsl:template>

</xsl:stylesheet>
105 changes: 50 additions & 55 deletions src/stylesheets/tei2html/tei2html_chapter.xsl
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,64 +1,59 @@
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:tei="http://www.tei-c.org/ns/1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:eoa="http://www.edition-open-access.de/ns"
exclude-result-prefixes="xs tei eoa"
version="2.0">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:eoa="http://www.edition-open-access.de/ns" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs tei eoa" version="2.0">

<xsl:param name="webdesign_url" as="xs:string" select="'/webdesign_platform'"/>
<xsl:param name="publ_static_url" as="xs:string" select="'/static'"/>
<xsl:param name="nav_items" as="element(eoa:entry)*">
<eoa:entry active="1">
<eoa:link>
<xsl:text>#</xsl:text>
</eoa:link>
<eoa:title>Publications</eoa:title>
</eoa:entry>
</xsl:param>
<xsl:param name="chapter_nr" as="xs:integer" required="1"/>
<xsl:param name="platform_name" as="xs:string" select="'dummy-platform'"/>
<xsl:param name="platform_uri" as="xs:string" select="'http://dummy-platform.com'"/>
<xsl:param name="aux_uri" as="xs:string" select="../../../data/aux"/>
<xsl:param name="webdesign_url" as="xs:string" select="'/webdesign_platform'"/>
<xsl:param name="publ_static_url" as="xs:string" select="'/static'"/>
<xsl:param name="nav_items" as="element(eoa:entry)*">
<eoa:entry active="1">
<eoa:link>
<xsl:text>#</xsl:text>
</eoa:link>
<eoa:title>Publications</eoa:title>
</eoa:entry>
</xsl:param>
<xsl:param name="chapter_nr" as="xs:integer" required="1"/>
<xsl:param name="platform_name" as="xs:string" select="'dummy-platform'"/>
<xsl:param name="platform_uri" as="xs:string" select="'http://dummy-platform.com'"/>
<xsl:param name="aux_uri" as="xs:string" select="../../../data/aux"/>
<xsl:param name="index_html" as="xs:boolean" select="false()"/>

<xsl:output method="html" encoding="UTF-8"/>

<xsl:include href="tei2html_chapter_utils.xsl"/>
<xsl:include href="utils/html_container.xsl"/>
<xsl:include href="utils/html_inline.xsl"/>
<xsl:include href="utils/common.xsl"/>
<xsl:include href="utils/print.xsl"/>
<xsl:include href="utils/render.xsl"/>
<xsl:include href="utils/numbering.xsl"/>
<xsl:include href="utils/index.xsl"/>
<xsl:include href="tei2html_chapter_utils.xsl"/>
<xsl:include href="utils/html_container.xsl"/>
<xsl:include href="utils/html_inline.xsl"/>
<xsl:include href="utils/common.xsl"/>
<xsl:include href="utils/print.xsl"/>
<xsl:include href="utils/render.xsl"/>
<xsl:include href="utils/numbering.xsl"/>
<xsl:include href="utils/index.xsl"/>

<xsl:template match="/">
<xsl:variable name="indices" as="element(eoa:index)*">
<xsl:variable name="ctxt" select="."/>
<xsl:for-each select="$index_types">
<xsl:variable name="index_type" as="xs:string" select="."/>
<xsl:for-each select="$ctxt">
<xsl:call-template name="create_index">
<xsl:with-param name="indextype" select="$index_type"/>
</xsl:call-template>
</xsl:for-each>
</xsl:for-each>
</xsl:variable>
<xsl:for-each select="(//tei:div[@type='chapter'])[position() = $chapter_nr]">
<xsl:variable name="heading">
<xsl:for-each select="tei:head">
<xsl:call-template name="render_heading"/>
</xsl:for-each>
</xsl:variable>
<xsl:sequence select="eoa:info(concat('printing chapter ', $chapter_nr, '. head: ', $heading))"/>
<xsl:call-template name="render_chapter">
<xsl:with-param name="webdesign_url" select="$webdesign_url"/>
<xsl:with-param name="publ_static_url" select="$publ_static_url"/>
<xsl:with-param name="nav_items" as="element(eoa:entry)*" select="$nav_items"/>
<xsl:with-param name="indices" as="element(eoa:index)*" select="$indices"/>
</xsl:call-template>
</xsl:for-each>
<xsl:variable name="indices" as="element(eoa:index)*">
<xsl:variable name="ctxt" select="."/>
<xsl:for-each select="$index_types">
<xsl:variable name="index_type" as="xs:string" select="."/>
<xsl:for-each select="$ctxt">
<xsl:call-template name="create_index">
<xsl:with-param name="indextype" select="$index_type"/>
</xsl:call-template>
</xsl:for-each>
</xsl:for-each>
</xsl:variable>
<xsl:for-each select="(//tei:div[@type='chapter'])[position() = $chapter_nr]">
<xsl:variable name="heading">
<xsl:for-each select="tei:head">
<xsl:call-template name="render_heading"/>
</xsl:for-each>
</xsl:variable>
<xsl:sequence select="eoa:info(concat('printing chapter ', $chapter_nr, '. head: ', $heading))"/>
<xsl:call-template name="render_chapter">
<xsl:with-param name="webdesign_url" select="$webdesign_url"/>
<xsl:with-param name="publ_static_url" select="$publ_static_url"/>
<xsl:with-param name="nav_items" as="element(eoa:entry)*" select="$nav_items"/>
<xsl:with-param name="indices" as="element(eoa:index)*" select="$indices"/>
<xsl:with-param name="index_html" as="xs:boolean" select="$index_html"/>
</xsl:call-template>
</xsl:for-each>
</xsl:template>

</xsl:stylesheet>
Loading

0 comments on commit a717901

Please sign in to comment.