Skip to content

Commit

Permalink
add markers where named templates can be converted to moded templates
Browse files Browse the repository at this point in the history
Signed-off-by: chrispy <[email protected]>
  • Loading branch information
chrispy-snps committed Dec 18, 2023
1 parent 01baaf2 commit 63c06e8
Show file tree
Hide file tree
Showing 31 changed files with 507 additions and 256 deletions.
6 changes: 4 additions & 2 deletions src/main/plugins/org.dita.base/xsl/preprocess/mappullImpl.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,8 @@ Other modes can be found within the code, and may or may not prove useful for ov
<xsl:value-of select="normalize-space($grabbed-value)"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="linktext-fallback"/>
<!--<xsl:apply-templates select="." mode="mappull:linktext-fallback"/>--><!-- #4207 -->
<xsl:call-template name="linktext-fallback"/><!-- #4207 -->
</xsl:otherwise>
</xsl:choose>
</xsl:when>
Expand All @@ -920,7 +921,8 @@ Other modes can be found within the code, and may or may not prove useful for ov
<xsl:value-of select="normalize-space($grabbed-value)"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="linktext-fallback"/>
<!--<xsl:apply-templates select="." mode="mappull:linktext-fallback"/>--><!-- #4207 -->
<xsl:call-template name="linktext-fallback"/><!-- #4207 -->
</xsl:otherwise>
</xsl:choose>
</xsl:when>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,8 @@ mode="topicpull:figure-linktext" and mode="topicpull:table-linktext"
<xsl:param name="linkElement" as="element()" tunnel="yes"/>

<xsl:for-each select="$linkElement">
<xsl:call-template name="topicpull:referenced-invalid-list-item"/>
<!--<xsl:apply-templates select="." mode="ditamsg:crossref-unordered-listitem"/>--><!-- #4207 -->
<xsl:call-template name="topicpull:referenced-invalid-list-item"/><!-- #4207 -->
</xsl:for-each>
</xsl:template>

Expand Down
39 changes: 26 additions & 13 deletions src/main/plugins/org.dita.html5/xsl/cover.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,17 @@ See the accompanying LICENSE file for applicable license.
<xsl:apply-templates select="." mode="addAttributesToBody"/>
<xsl:call-template name="setidaname"/>
<xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-startprop ')]" mode="out-of-line"/>
<xsl:call-template name="generateBreadcrumbs"/>
<xsl:call-template name="gen-user-header"/>
<xsl:call-template name="processHDR"/>
<!--<xsl:apply-templates select="." mode="generateBreadcrumbs"/>--><!-- #4207 -->
<xsl:call-template name="generateBreadcrumbs"/><!-- #4207 -->
<!--<xsl:apply-templates select="." mode="gen-user-header"/>--><!-- #4207 -->
<xsl:call-template name="gen-user-header"/><!-- #4207 -->
<!--<xsl:apply-templates select="." mode="processHDR"/>--><!-- #4207 -->
<xsl:call-template name="processHDR"/><!-- #4207 -->
<xsl:if test="$INDEXSHOW = 'yes'">
<xsl:apply-templates select="/*/*[contains(@class, ' map/topicmeta ')]/*[contains(@class, ' topic/keywords ')]/*[contains(@class, ' topic/indexterm ')]"/>
</xsl:if>
<xsl:call-template name="gen-user-sidetoc"/>
<!--<xsl:apply-templates select="." mode="gen-user-sidetoc"/>--><!-- #4207 -->
<xsl:call-template name="gen-user-sidetoc"/><!-- #4207 -->
<xsl:choose>
<xsl:when test="*[contains(@class, ' topic/title ')]">
<xsl:apply-templates select="*[contains(@class, ' topic/title ')]"/>
Expand All @@ -156,30 +160,36 @@ See the accompanying LICENSE file for applicable license.
<xsl:apply-templates select="." mode="normalize-map"/>
</xsl:variable>
<xsl:apply-templates select="$map" mode="toc"/>
<xsl:call-template name="gen-endnotes"/>
<xsl:call-template name="gen-user-footer"/>
<xsl:call-template name="processFTR"/>
<!--<xsl:apply-templates select="." mode="gen-endnotes"/>--><!-- #4207 -->
<xsl:call-template name="gen-endnotes"/><!-- #4207 -->
<!--<xsl:apply-templates select="." mode="gen-user-footer"/>--><!-- #4207 -->
<xsl:call-template name="gen-user-footer"/><!-- #4207 -->
<!--<xsl:apply-templates select="." mode="processFTR"/>--><!-- #4207 -->
<xsl:call-template name="processFTR"/><!-- #4207 -->
<xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-endprop ')]" mode="out-of-line"/>
</body>
</xsl:template>

<xsl:template match="*[contains(@class, ' map/map ')]/*[contains(@class, ' topic/title ')]">
<h1 class="title topictitle1">
<xsl:call-template name="gen-user-panel-title-pfx"/>
<!--<xsl:apply-templates select="." mode="gen-user-panel-title-pfx"/>--><!-- #4207 -->
<xsl:call-template name="gen-user-panel-title-pfx"/><!-- #4207 -->
<xsl:apply-templates/>
</h1>
</xsl:template>

<xsl:template match="*[contains(@class, ' map/map ')]/@title">
<h1 class="title topictitle1">
<xsl:call-template name="gen-user-panel-title-pfx"/>
<!--<xsl:apply-templates select="." mode="gen-user-panel-title-pfx"/>--><!-- #4207 -->
<xsl:call-template name="gen-user-panel-title-pfx"/><!-- #4207 -->
<xsl:value-of select="."/>
</h1>
</xsl:template>

<xsl:template match="*[contains(@class,' bookmap/bookmap ')]/*[contains(@class,' bookmap/booktitle ')]" priority="10">
<h1 class="title topictitle1">
<xsl:call-template name="gen-user-panel-title-pfx"/>
<!--<xsl:apply-templates select="." mode="gen-user-panel-title-pfx"/>--><!-- #4207 -->
<xsl:call-template name="gen-user-panel-title-pfx"/><!-- #4207 -->
<xsl:apply-templates select="*[contains(@class, ' bookmap/mainbooktitle ')]/node()"/>
</h1>
</xsl:template>
Expand All @@ -188,15 +198,18 @@ See the accompanying LICENSE file for applicable license.
<title>
<xsl:choose>
<xsl:when test="/*[contains(@class,' bookmap/bookmap ')]/*[contains(@class,' bookmap/booktitle ')]/*[contains(@class, ' bookmap/mainbooktitle ')]">
<xsl:call-template name="gen-user-panel-title-pfx"/>
<!--<xsl:apply-templates select="." mode="gen-user-panel-title-pfx"/>--><!-- #4207 -->
<xsl:call-template name="gen-user-panel-title-pfx"/><!-- #4207 -->
<xsl:value-of select="/*[contains(@class,' bookmap/bookmap ')]/*[contains(@class,' bookmap/booktitle ')]/*[contains(@class, ' bookmap/mainbooktitle ')]"/>
</xsl:when>
<xsl:when test="/*[contains(@class,' map/map ')]/*[contains(@class,' topic/title ')]">
<xsl:call-template name="gen-user-panel-title-pfx"/>
<!--<xsl:apply-templates select="." mode="gen-user-panel-title-pfx"/>--><!-- #4207 -->
<xsl:call-template name="gen-user-panel-title-pfx"/><!-- #4207 -->
<xsl:value-of select="/*[contains(@class,' map/map ')]/*[contains(@class,' topic/title ')]"/>
</xsl:when>
<xsl:when test="/*[contains(@class,' map/map ')]/@title">
<xsl:call-template name="gen-user-panel-title-pfx"/>
<!--<xsl:apply-templates select="." mode="gen-user-panel-title-pfx"/>--><!-- #4207 -->
<xsl:call-template name="gen-user-panel-title-pfx"/><!-- #4207 -->
<xsl:value-of select="/*[contains(@class,' map/map ')]/@title"/>
</xsl:when>
</xsl:choose>
Expand Down
18 changes: 12 additions & 6 deletions src/main/plugins/org.dita.html5/xsl/rel-links.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ See the accompanying LICENSE file for applicable license.
<!--use xref content-->
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href"/><!--use href text-->
<!--<xsl:apply-templates select="." mode="determine-final-href"/>--><!--use href text--><!-- #4207 -->
<xsl:call-template name="href"/><!--use href text--><!-- #4207 -->
</xsl:otherwise>
</xsl:choose>
</sup>
Expand All @@ -81,7 +82,8 @@ See the accompanying LICENSE file for applicable license.
<xsl:value-of select="replace(@href, '^mailto:', '')"/><!--remove mailto: prefix from href text-->
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href"/><!--use href text-->
<!--<xsl:apply-templates select="." mode="determine-final-href"/>--><!--use href text--><!-- #4207 -->
<xsl:call-template name="href"/><!--use href text--><!-- #4207 -->
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
Expand Down Expand Up @@ -461,7 +463,8 @@ Each child is indented, the linktext is bold, and the shortdesc appears in norma
</xsl:when>
<xsl:otherwise>
<!--use href-->
<xsl:call-template name="href"/>
<!--<xsl:apply-templates select="." mode="determine-final-href"/>--><!-- #4207 -->
<xsl:call-template name="href"/><!-- #4207 -->
</xsl:otherwise>
</xsl:choose>
</a>
Expand Down Expand Up @@ -496,7 +499,8 @@ Each child is indented, the linktext is bold, and the shortdesc appears in norma
</xsl:when>
<xsl:otherwise>
<!--use href-->
<xsl:call-template name="href"/>
<!--<xsl:apply-templates select="." mode="determine-final-href"/>--><!-- #4207 -->
<xsl:call-template name="href"/><!-- #4207 -->
</xsl:otherwise>
</xsl:choose>
</a>
Expand Down Expand Up @@ -570,7 +574,8 @@ Each child is indented, the linktext is bold, and the shortdesc appears in norma
</xsl:when>
<xsl:otherwise>
<!--use href-->
<xsl:call-template name="href"/>
<!--<xsl:apply-templates select="." mode="determine-final-href"/>--><!-- #4207 -->
<xsl:call-template name="href"/><!-- #4207 -->
</xsl:otherwise>
</xsl:choose>
</a>
Expand Down Expand Up @@ -712,7 +717,8 @@ Each child is indented, the linktext is bold, and the shortdesc appears in norma
<xsl:value-of select="normalize-space(*[contains(@class, ' topic/linktext ')])"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href"/>
<!--<xsl:apply-templates select="." mode="determine-final-href"/>--><!-- #4207 -->
<xsl:call-template name="href"/><!-- #4207 -->
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
Expand Down
63 changes: 42 additions & 21 deletions src/main/plugins/org.dita.html5/xsl/topic.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,8 @@ See the accompanying LICENSE file for applicable license.
<xsl:when test="@href">
<br/><div><a>
<xsl:attribute name="href">
<xsl:call-template name="href"/>
<!--<xsl:apply-templates select="." mode="determine-final-href"/>--><!-- #4207 -->
<xsl:call-template name="href"/><!-- #4207 -->
</xsl:attribute>
<xsl:choose>
<xsl:when test="@type = 'external'">
Expand Down Expand Up @@ -2331,9 +2332,12 @@ See the accompanying LICENSE file for applicable license.

<xsl:template name="chapter-setup">
<html>
<xsl:call-template name="setTopicLanguage"/>
<xsl:call-template name="chapterHead"/>
<xsl:call-template name="chapterBody"/>
<!--<xsl:apply-templates select="." mode="setTopicLanguage"/>--><!-- #4207 -->
<xsl:call-template name="setTopicLanguage"/><!-- #4207 -->
<!--<xsl:apply-templates select="." mode="chapterHead"/>--><!-- #4207 -->
<xsl:call-template name="chapterHead"/><!-- #4207 -->
<!--<xsl:apply-templates select="." mode="chapterBody"/>--><!-- #4207 -->
<xsl:call-template name="chapterBody"/><!-- #4207 -->
</html>
</xsl:template>

Expand All @@ -2360,17 +2364,26 @@ See the accompanying LICENSE file for applicable license.
<xsl:template match="*" mode="chapterHead">
<head>
<!-- initial meta information -->
<xsl:call-template name="generateCharset"/> <!-- Set the character set to UTF-8 -->
<!--<xsl:apply-templates select="." mode="generateCharset"/>--> <!-- Set the character set to UTF-8 --><!-- #4207 -->
<xsl:call-template name="generateCharset"/> <!-- Set the character set to UTF-8 --><!-- #4207 -->
<xsl:apply-templates select="." mode="generateDefaultCopyright"/> <!-- Generate a default copyright, if needed -->
<xsl:call-template name="generateDefaultMeta"/> <!-- Standard meta for security, robots, etc -->
<!--<xsl:apply-templates select="." mode="generateDefaultMeta"/>--> <!-- Standard meta for security, robots, etc --><!-- #4207 -->
<xsl:call-template name="generateDefaultMeta"/> <!-- Standard meta for security, robots, etc --><!-- #4207 -->
<xsl:apply-templates select="." mode="getMeta"/> <!-- Process metadata from topic prolog -->
<xsl:call-template name="copyright"/> <!-- Generate copyright, if specified manually -->
<xsl:call-template name="generateChapterTitle"/> <!-- Generate the <title> element -->
<xsl:call-template name="gen-user-head" /> <!-- include user's XSL HEAD processing here -->
<xsl:call-template name="gen-user-scripts" /> <!-- include user's XSL javascripts here -->
<xsl:call-template name="gen-user-styles" /> <!-- include user's XSL style element and content here -->
<xsl:call-template name="processHDF"/> <!-- Add user HDF file, if specified -->
<xsl:call-template name="generateCssLinks"/> <!-- Generate links to CSS files -->
<!--<xsl:apply-templates select="." mode="copyright"/>--> <!-- Generate copyright, if specified manually --><!-- #4207 -->
<xsl:call-template name="copyright"/> <!-- Generate copyright, if specified manually --><!-- #4207 -->
<!--<xsl:apply-templates select="." mode="generateChapterTitle"/>--> <!-- Generate the <title> element --><!-- #4207 -->
<xsl:call-template name="generateChapterTitle"/> <!-- Generate the <title> element --><!-- #4207 -->
<!--<xsl:apply-templates select="." mode="gen-user-head"/>--> <!-- include user's XSL HEAD processing here --><!-- #4207 -->
<xsl:call-template name="gen-user-head" /> <!-- include user's XSL HEAD processing here --><!-- #4207 -->
<!--<xsl:apply-templates select="." mode="gen-user-scripts"/>--> <!-- include user's XSL javascripts here --><!-- #4207 -->
<xsl:call-template name="gen-user-scripts" /> <!-- include user's XSL javascripts here --><!-- #4207 -->
<!--<xsl:apply-templates select="." mode="gen-user-styles"/>--> <!-- include user's XSL style element and content here --><!-- #4207 -->
<xsl:call-template name="gen-user-styles" /> <!-- include user's XSL style element and content here --><!-- #4207 -->
<!--<xsl:apply-templates select="." mode="processHDF"/>--> <!-- Add user HDF file, if specified --><!-- #4207 -->
<xsl:call-template name="processHDF"/> <!-- Add user HDF file, if specified --><!-- #4207 -->
<!--<xsl:apply-templates select="." mode="generateCssLinks"/>--> <!-- Generate links to CSS files --><!-- #4207 -->
<xsl:call-template name="generateCssLinks"/> <!-- Generate links to CSS files --><!-- #4207 -->
</head>
</xsl:template>

Expand Down Expand Up @@ -2471,7 +2484,8 @@ See the accompanying LICENSE file for applicable license.
<xsl:template match="/ | @* | node()" mode="generateChapterTitle">
<!-- Title processing - special handling for short descriptions -->
<title>
<xsl:call-template name="gen-user-panel-title-pfx"/> <!-- hook for a user-XSL title prefix -->
<!--<xsl:apply-templates select="." mode="gen-user-panel-title-pfx"/>--> <!-- hook for a user-XSL title prefix --><!-- #4207 -->
<xsl:call-template name="gen-user-panel-title-pfx"/> <!-- hook for a user-XSL title prefix --><!-- #4207 -->
<xsl:variable name="maintitle"><xsl:apply-templates select="/*[contains(@class, ' topic/topic ')]/*[contains(@class, ' topic/title ')]" mode="text-only"/></xsl:variable>
<xsl:variable name="ditamaintitle"><xsl:apply-templates select="/dita/*[contains(@class, ' topic/topic ')][1]/*[contains(@class, ' topic/title ')]" mode="text-only"/></xsl:variable>
<xsl:choose>
Expand Down Expand Up @@ -2505,7 +2519,8 @@ See the accompanying LICENSE file for applicable license.
<xsl:apply-templates select="." mode="addHeaderToHtmlBodyElement"/>

<!-- Include a user's XSL call here to generate a toc based on what's a child of topic -->
<xsl:call-template name="gen-user-sidetoc"/>
<!--<xsl:apply-templates select="." mode="gen-user-sidetoc"/>--><!-- #4207 -->
<xsl:call-template name="gen-user-sidetoc"/><!-- #4207 -->

<xsl:apply-templates select="." mode="addContentToHtmlBodyElement"/>
<xsl:apply-templates select="." mode="addFooterToHtmlBodyElement"/>
Expand Down Expand Up @@ -2542,9 +2557,12 @@ See the accompanying LICENSE file for applicable license.
<!-- Process <body> content that is appropriate for HTML5 header section. -->
<xsl:template match="*" mode="addHeaderToHtmlBodyElement">
<xsl:variable name="header-content" as="node()*">
<xsl:call-template name="generateBreadcrumbs"/>
<xsl:call-template name="gen-user-header"/> <!-- include user's XSL running header here -->
<xsl:call-template name="processHDR"/>
<!--<xsl:apply-templates select="." mode="generateBreadcrumbs"/>--><!-- #4207 -->
<xsl:call-template name="generateBreadcrumbs"/><!-- #4207 -->
<!--<xsl:apply-templates select="." mode="gen-user-header"/>--> <!-- include user's XSL running header here --><!-- #4207 -->
<xsl:call-template name="gen-user-header"/> <!-- include user's XSL running header here --><!-- #4207 -->
<!--<xsl:apply-templates select="." mode="processHDR"/>--><!-- #4207 -->
<xsl:call-template name="processHDR"/><!-- #4207 -->
<xsl:if test="$INDEXSHOW = 'yes'">
<xsl:apply-templates select="/*/*[contains(@class, ' topic/prolog ')]/*[contains(@class, ' topic/metadata ')]/*[contains(@class, ' topic/keywords ')]/*[contains(@class, ' topic/indexterm ')] |
/dita/*[1]/*[contains(@class, ' topic/prolog ')]/*[contains(@class, ' topic/metadata ')]/*[contains(@class, ' topic/keywords ')]/*[contains(@class, ' topic/indexterm ')]"/>
Expand Down Expand Up @@ -2581,7 +2599,8 @@ See the accompanying LICENSE file for applicable license.
<!-- followed by body content, again by fall-through in document order -->
<!-- followed by related links -->
<!-- followed by child topics by fall-through -->
<xsl:call-template name="gen-endnotes"/> <!-- include footnote-endnotes -->
<!--<xsl:apply-templates select="." mode="gen-endnotes"/>--> <!-- include footnote-endnotes --><!-- #4207 -->
<xsl:call-template name="gen-endnotes"/> <!-- include footnote-endnotes --><!-- #4207 -->
<xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-endprop ')]" mode="out-of-line"/>
</article>
</main>
Expand All @@ -2594,8 +2613,10 @@ See the accompanying LICENSE file for applicable license.

<xsl:template match="*" mode="addFooterToHtmlBodyElement">
<xsl:variable name="footer-content" as="node()*">
<xsl:call-template name="gen-user-footer"/> <!-- include user's XSL running footer here -->
<xsl:call-template name="processFTR"/> <!-- Include XHTML footer, if specified -->
<!--<xsl:apply-templates select="." mode="gen-user-footer"/>--> <!-- include user's XSL running footer here --><!-- #4207 -->
<xsl:call-template name="gen-user-footer"/> <!-- include user's XSL running footer here --><!-- #4207 -->
<!--<xsl:apply-templates select="." mode="processFTR"/>--> <!-- Include XHTML footer, if specified --><!-- #4207 -->
<xsl:call-template name="processFTR"/> <!-- Include XHTML footer, if specified --><!-- #4207 -->
</xsl:variable>
<xsl:if test="exists($footer-content)">
<footer xsl:use-attribute-sets="footer">
Expand Down
3 changes: 2 additions & 1 deletion src/main/plugins/org.dita.html5/xsl/ut-d.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ See the accompanying LICENSE file for applicable license.

<!-- In the context of XREF - call it's HREF processor -->
<xsl:template match="*[contains(@class, ' topic/xref ')]" mode="imagemap-xref">
<xsl:attribute name="href"><xsl:call-template name="href"/></xsl:attribute>
<!--<xsl:attribute name="href"><xsl:apply-templates select="." mode="determine-final-href"/></xsl:attribute>--><!-- #4207 -->
<xsl:attribute name="href"><xsl:call-template name="href"/></xsl:attribute><!-- #4207 -->
<xsl:if test="@scope='external' or @type='external' or ((@format='PDF' or @format='pdf') and not(@scope='local'))">
<xsl:apply-templates select="." mode="external-link"/>
</xsl:if>
Expand Down
Loading

0 comments on commit 63c06e8

Please sign in to comment.