Skip to content

Commit

Permalink
remove unreferenced XSLT variables
Browse files Browse the repository at this point in the history
Signed-off-by: chrispy <[email protected]>
  • Loading branch information
chrispy-snps authored and jelovirt committed Aug 19, 2023
1 parent 2b65dd3 commit 9704efb
Show file tree
Hide file tree
Showing 10 changed files with 4 additions and 62 deletions.
2 changes: 0 additions & 2 deletions src/main/plugins/org.dita.base/xsl/common/output-message.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ See the accompanying LICENSE file for applicable license.
<xsl:variable name="msgseverity" as="xs:string*">
<xsl:value-of select="$msgdoc/messages/message[@id = $id]/@type"/>
</xsl:variable>
<xsl:variable name="localclass" select="$ctx/@class" as="attribute(class)?"/>
<xsl:variable name="xtrf" select="$ctx/@xtrf" as="attribute(xtrf)?"/>
<xsl:variable name="xtrc" select="$ctx/@xtrc" as="attribute(xtrc)?"/>
<xsl:variable name="debugloc">
Expand Down Expand Up @@ -86,7 +85,6 @@ See the accompanying LICENSE file for applicable license.
<xsl:param name="params"/>
<xsl:variable name="reason" select="reason/text()"/>
<xsl:variable name="response" select="response/text()"/>
<xsl:variable name="messageType" select="@type"/>
<xsl:text>[</xsl:text><xsl:value-of select="@id"/><xsl:text>]</xsl:text>
<xsl:text>[</xsl:text><xsl:value-of select="@type"/><xsl:text>]</xsl:text>
<xsl:text>: </xsl:text>
Expand Down
6 changes: 0 additions & 6 deletions src/main/plugins/org.dita.base/xsl/preprocess/conrefImpl.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@ See the accompanying LICENSE file for applicable license.
conref straight to conref, then just save the first one (in source-attributes) -->

<!--get element local name, parent topic's domains, and then file name, topic id, element id from conref value-->
<xsl:variable name="element" select="local-name(.)"/>
<!--xsl:variable name="domains"><xsl:value-of select="ancestor-or-self::*[@domains][1]/@domains"/></xsl:variable-->

<xsl:variable name="file-prefix" select="concat($WORKDIR, $current-relative-path)" as="xs:string"/>

Expand Down Expand Up @@ -216,9 +214,6 @@ See the accompanying LICENSE file for applicable license.
<!-- conref file name with relative path -->
<xsl:variable name="filename" select="substring-after($file-origin, $file-prefix)"/>

<!-- replace the extension name -->
<xsl:variable name="FILENAME" select="concat(substring-before($filename, '.'), '.dita')"/>

<xsl:variable name="topicid" select="dita-ot:get-topic-id(@conref)" as="xs:string?"/>
<xsl:variable name="elemid" select="dita-ot:get-element-id(@conref)" as="xs:string?"/>
<xsl:variable name="lastClassToken" select="concat(' ', tokenize(normalize-space(@class), ' ')[last()], ' ')" as="xs:string"/>
Expand Down Expand Up @@ -285,7 +280,6 @@ See the accompanying LICENSE file for applicable license.
</xsl:variable>
<xsl:choose>
<xsl:when test="$target">
<xsl:variable name="firstTopicId" select="if (exists($topicid)) then $topicid else $target/@id"/>
<xsl:apply-templates select="$target[1]" mode="conref-target">
<xsl:with-param name="source-attributes" as="xs:string*">
<xsl:choose>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ See the accompanying LICENSE file for applicable license.
<xsl:param name="relative-path" as="xs:string">#none#</xsl:param>
<xsl:param name="mapref-id-path" as="xs:string*"/>
<xsl:param name="parentMaprefKeyscope" tunnel="yes" as="attribute()?"/>
<xsl:variable name="mapID" select="@id"/>
<xsl:apply-templates select="*[contains(@class,' map/reltable ')]" mode="reltable-copy">
<xsl:with-param name="relative-path" select="$relative-path" tunnel="yes"/>
<xsl:with-param name="keyscope" select="string-join((@keyscope, $parentMaprefKeyscope), ' ')"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,6 @@ mode="topicpull:figure-linktext" and mode="topicpull:table-linktext"
<xsl:apply-templates select="@*"/>
<!--create variables for attributes that will be passed by parameter to the getstuff template (which is shared with link, which needs the attributes in variables to save doing inheritance checks for each one)-->
<xsl:variable name="type" as="xs:string?" select="@type"/>
<xsl:variable name="format" as="xs:string?" select="@format"/>
<xsl:variable name="scope" as="xs:string?" select="@format"/>
<!--grab type, text and metadata, as long there's an href to grab from, otherwise error-->
<xsl:apply-templates select="." mode="topicpull:get-stuff">
<xsl:with-param name="localtype" select="$type" as="xs:string?"/>
Expand Down Expand Up @@ -608,13 +606,6 @@ mode="topicpull:figure-linktext" and mode="topicpull:table-linktext"
<xsl:with-param name="targetElement" select="$targetElement" as="element()"/>
</xsl:apply-templates>

<!--create class value string implied by the link's type, used for comparison with class strings in the target topic for validation-->
<xsl:variable name="classval" as="xs:string"
select="if (dita-ot:is-topic($targetElement))
then tokenize(substring($targetElement/@class, 3), ' ')[1]
else concat('/', substring-after(tokenize(substring($targetElement/@class, 3), ' ')[1], '/'))
"/>

<!--linktext-->
<xsl:apply-templates select="." mode="topicpull:get-stuff_get-linktext">
<xsl:with-param name="targetElement" select="$targetElement" as="element()"/>
Expand Down
4 changes: 0 additions & 4 deletions src/main/plugins/org.dita.html5/xsl/reference.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ See the accompanying LICENSE file for applicable license.
</xsl:template>

<xsl:template name="gen-propdeschd">
<xsl:variable name="properties" select="ancestor-or-self::*[contains(@class,' reference/properties ')][1]"/>
<propdeschd class="- topic/stentry reference/propdeschd ">
<xsl:call-template name="getVariable">
<xsl:with-param name="id" select="'Description'"/>
Expand Down Expand Up @@ -172,9 +171,6 @@ See the accompanying LICENSE file for applicable license.
<xsl:apply-templates select="*[contains(@class,' reference/propdeschd ')]"/>
</xsl:when>
<xsl:when test="$hasDesc">
<xsl:variable name="propdeschd" as="element()">
<xsl:call-template name="gen-propdeschd"/>
</xsl:variable>
<th scope="col">
<xsl:call-template name="style">
<xsl:with-param name="contents">
Expand Down
32 changes: 1 addition & 31 deletions src/main/plugins/org.dita.pdf2/xsl/fo/flag-rules.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ See the accompanying LICENSE file for applicable license.
<xsl:with-param name="propsPath" select="substring-before($props,',')"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="propName">
<xsl:call-template name="getLastPropName">
<xsl:with-param name="propsPath" select="substring-before($props,',')"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="not($propsValue='')">
<xsl:call-template name="ext-gen-prop">
<xsl:with-param name="flag-att-path" select="substring-before($props,',')"/>
Expand All @@ -114,11 +109,6 @@ See the accompanying LICENSE file for applicable license.
<xsl:with-param name="propsPath" select="$props"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="propName">
<xsl:call-template name="getLastPropName">
<xsl:with-param name="propsPath" select="$props"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="not($propsValue='')">
<xsl:call-template name="ext-gen-prop">
<xsl:with-param name="flag-att-path" select="$props"/>
Expand Down Expand Up @@ -204,11 +194,6 @@ See the accompanying LICENSE file for applicable license.
<xsl:with-param name="propsPath" select="substring-before($props,',')"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="propName">
<xsl:call-template name="getLastPropName">
<xsl:with-param name="propsPath" select="substring-before($props,',')"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="not($propsValue='')">

</xsl:if>
Expand All @@ -223,11 +208,6 @@ See the accompanying LICENSE file for applicable license.
<xsl:with-param name="propsPath" select="$props"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="propName">
<xsl:call-template name="getLastPropName">
<xsl:with-param name="propsPath" select="$props"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="not($propsValue='')">

</xsl:if>
Expand Down Expand Up @@ -297,11 +277,6 @@ See the accompanying LICENSE file for applicable license.
<xsl:with-param name="propsPath" select="substring-before($props,',')"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="propName">
<xsl:call-template name="getLastPropName">
<xsl:with-param name="propsPath" select="substring-before($props,',')"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="not($propsValue='')">
<xsl:call-template name="ext-gen-prop">
<xsl:with-param name="flag-att-path" select="substring-before($props,',')"/>
Expand All @@ -319,11 +294,6 @@ See the accompanying LICENSE file for applicable license.
<xsl:with-param name="propsPath" select="$props"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="propName">
<xsl:call-template name="getLastPropName">
<xsl:with-param name="propsPath" select="$props"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="not($propsValue='')">
<xsl:call-template name="ext-gen-prop">
<xsl:with-param name="flag-att-path" select="$props"/>
Expand Down Expand Up @@ -602,4 +572,4 @@ See the accompanying LICENSE file for applicable license.


<!-- ===================================================================== -->
</xsl:stylesheet>
</xsl:stylesheet>
3 changes: 1 addition & 2 deletions src/main/plugins/org.dita.pdf2/xsl/fo/hazard-d.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ See the accompanying license.txt file for applicable licenses.

<xsl:template match="*[contains(@class, ' hazard-d/hazardstatement ')]">
<xsl:variable name="type" select="(@type, 'caution')[1]" as="xs:string"/>
<xsl:variable name="number-cells" as="xs:integer" select="2"/>
<xsl:apply-templates select="*[contains(@class,' ditaot-d/ditaval-startprop ')]" mode="outofline"/>
<fo:table xsl:use-attribute-sets="hazardstatement">
<xsl:call-template name="commonattributes"/>
Expand Down Expand Up @@ -126,4 +125,4 @@ See the accompanying license.txt file for applicable licenses.
</fo:block>
</xsl:template>

</xsl:stylesheet>
</xsl:stylesheet>
4 changes: 1 addition & 3 deletions src/main/plugins/org.dita.pdf2/xsl/fo/index.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ See the accompanying LICENSE file for applicable license.
<xsl:if test="count(preceding-sibling::opentopic-index:index.entry[@value = $value]) = 0">
<xsl:variable name="page-setting" select=" (ancestor-or-self::opentopic-index:index.entry/@no-page | ancestor-or-self::opentopic-index:index.entry/@start-page)[last()]"/>
<xsl:variable name="isNoPage" select=" $page-setting = 'true' and name($page-setting) = 'no-page' "/>
<xsl:variable name="refID" select="opentopic-index:refID/@value"/>
<xsl:choose>
<xsl:when test="$following-idx">
<xsl:apply-templates select="." mode="make-index-ref">
Expand Down Expand Up @@ -456,7 +455,6 @@ See the accompanying LICENSE file for applicable license.
<xsl:if test="count(ancestor::opentopic-index:index.entry) > 0">
<xsl:attribute name="keep-together.within-page">always</xsl:attribute>
</xsl:if>
<xsl:variable name="following-idx" select="following-sibling::opentopic-index:index.entry[@value = $value and opentopic-index:refID]"/>
<xsl:if test="count(preceding-sibling::opentopic-index:index.entry[@value = $value]) = 0">
<xsl:variable name="page-setting" select="(ancestor-or-self::opentopic-index:index.entry/@no-page | ancestor-or-self::opentopic-index:index.entry/@start-page)[last()]"/>
<xsl:variable name="isNoPage" select="$page-setting = 'true' and name($page-setting) = 'no-page' "/>
Expand Down Expand Up @@ -596,4 +594,4 @@ See the accompanying LICENSE file for applicable license.
</xsl:template>


</xsl:stylesheet>
</xsl:stylesheet>
2 changes: 1 addition & 1 deletion src/main/plugins/org.dita.pdf2/xsl/fo/topic.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ See the accompanying LICENSE file for applicable license.
</xsl:variable>
<xsl:choose>
<!-- Disable chapter title processing when mini TOC is created -->
<xsl:when test="(topicType = 'topicChapter') or (topicType = 'topicAppendix')" />
<xsl:when test="($topicType = 'topicChapter') or ($topicType = 'topicAppendix')" />
<!-- Normal processing -->
<xsl:otherwise>
<xsl:apply-templates select="." mode="processTopicTitle"/>
Expand Down
3 changes: 0 additions & 3 deletions src/main/plugins/org.dita.xhtml/xsl/xslhtml/refdisplay.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,6 @@ See the accompanying LICENSE file for applicable license.
<xsl:apply-templates select="*[contains(@class,' reference/propdeschd ')]"/>
</xsl:when>
<xsl:when test="$hasDesc">
<xsl:variable name="propdeschd" as="element()">
<xsl:call-template name="gen-propdeschd"/>
</xsl:variable>
<th>
<xsl:call-template name="style">
<xsl:with-param name="contents">
Expand Down

0 comments on commit 9704efb

Please sign in to comment.