Skip to content

Commit

Permalink
Merge pull request #1635 from michaelhkay/Drop-40-suffix-in-cross-spe…
Browse files Browse the repository at this point in the history
…c-links

Abbreviate suffixes on cross-spec links
  • Loading branch information
ndw authored Dec 9, 2024
2 parents 4b2cb10 + 231ebb3 commit d3a0d6e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
4 changes: 2 additions & 2 deletions specifications/xpath-functions-40/src/xpath-functions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ for transition to Proposed Recommendation. </p>'>
cross-document links in this document. Each such link consists of a pointer to a
specific section followed a superscript specifying the linked document. The
superscripts have the following meanings: XQ <bibref ref="xquery-40"/>, XT <bibref ref="xslt-40"/>,
XP <bibref ref="xpath-40"/>, and DM <bibref ref="xpath-datamodel-31"/>.</p>
XP <bibref ref="xpath-40"/>, and DM <bibref ref="xpath-datamodel-40"/>.</p>

<div2 id="operators" diff="add" at="2022-12-20">
<head>Operators</head>
Expand Down Expand Up @@ -12662,7 +12662,7 @@ currently, Version 9.0.0.
<!--<bibl id="xquery-30"
key="XQuery 3.0: An XML Query Language"/>-->
<bibl id="xquery-40"
key="XQuery 4.1: An XML Query Language">
key="XQuery 4.0: An XML Query Language">
<emph>CITATION: T.B.D.</emph>
</bibl>
<!--<bibl id="xmlschema-1"
Expand Down
4 changes: 2 additions & 2 deletions specifications/xslt-40/src/xslt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@
<p>
<emph>This document contains hyperlinks to specific sections or definitions within other
documents in this family of specifications. These links are indicated visually by a
superscript identifying the target specification: for example XP40 for XPath 4.0,
DM40 for the XDM data model version 4.0, FO40 for Functions and Operators version
superscript identifying the target specification: for example XP for XPath 4.0,
DM for the XDM data model version 4.0, FO for Functions and Operators version
4.0.</emph>
</p>

Expand Down
8 changes: 4 additions & 4 deletions specifications/xslt-40/style/xslt.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -773,12 +773,12 @@ constructor. These elements are:</p>
<xsl:variable name="link" select="translate(if (contains($fname, '#')) then substring-before($fname, '#') else $fname, ':', '-')"/>
<xsl:variable name="vn" select="if (@spec eq 'FO31') then '31' else if (@spec eq '30') then '30' else '40'"/>
<xsl:variable name="baseuri"
select="if ($vn = '40')
then 'https://www.w3.org/TR/xpath-functions'
else 'https://qt4cg.org/specifications/xpath-functions'"/>
select="if ($vn = '40')
then 'https://qt4cg.org/specifications/xpath-functions'
else 'https://www.w3.org/TR/xpath-functions'"/>
<a href="{$baseuri}-{$vn}/#func-{$link}">
<code><xsl:value-of select="."/></code>
</a><sup><small><xsl:value-of select="(@spec, 'FO40')[1]"/></small></sup>
</a><sup><small><xsl:value-of select="(@spec, 'FO')[1]"/></small></sup>
</xsl:template>

<xsl:template match="termref">
Expand Down
21 changes: 11 additions & 10 deletions style/xsl-query-2016.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@
<xsl:variable name="div" select="$doc//*[@id=$ref]"/>
<xsl:variable name="nt" select="($doc//*[@def=$ref])[1]"/>
<xsl:variable name="uri" select="replace($doc/document-summary/@uri, '^http:', 'https:')"/>

<xsl:variable name="shortSpec" select="replace(@spec, '40$', '')"/>
<xsl:choose>
<xsl:when test="$div">
<xsl:variable name="linktext">
Expand All @@ -770,7 +770,7 @@
</xsl:choose>
<sup>
<small>
<xsl:value-of select="@spec"/>
<xsl:value-of select="$shortSpec"/>
</small>
</sup>
</xsl:when>
Expand All @@ -787,7 +787,7 @@
</xsl:choose>
<sup>
<small>
<xsl:value-of select="@spec"/>
<xsl:value-of select="$shortSpec"/>
</small>
</sup>
</xsl:when>
Expand All @@ -804,7 +804,7 @@
</xsl:choose>
<sup>
<small>
<xsl:value-of select="@spec"/>
<xsl:value-of select="$shortSpec"/>
</small>
</sup>
</xsl:when>
Expand Down Expand Up @@ -855,7 +855,7 @@
-->
<xsl:variable name="nt" select="($doc//prod[@id=$ref], $doc//prod[.=$ref], $doc//nt[@def=$ref])[1]"/>
<xsl:variable name="uri" select="replace($doc/document-summary/@uri, '^http:', 'https:')"/>

<xsl:variable name="shortSpec" select="replace(@spec, '40$', '')"/>
<xsl:choose>
<xsl:when test="contains(@spec, 'XP') and not($nt)">
<!-- XP and XQ are a special case -->
Expand All @@ -879,7 +879,7 @@
</xsl:choose>
<sup>
<small>
<xsl:value-of select="@spec"/>
<xsl:value-of select="$shortSpec"/>
</small>
</sup>
</xsl:when>
Expand All @@ -906,7 +906,7 @@
</xsl:choose>
<sup>
<small>
<xsl:value-of select="@spec"/>
<xsl:value-of select="$shortSpec"/>
</small>
</sup>
</xsl:when>
Expand All @@ -929,7 +929,7 @@
</xsl:choose>
<sup>
<small>
<xsl:value-of select="@spec"/>
<xsl:value-of select="$shortSpec"/>
</small>
</sup>
</xsl:otherwise>
Expand Down Expand Up @@ -1002,6 +1002,7 @@
<xsl:variable name="doc" select="document(concat('../build/etc/', @spec, '.xml'))"/>
<xsl:variable name="termdef" select="$doc//termdef[@id=$ref]"/>
<xsl:variable name="uri" select="replace($doc/document-summary/@uri, '^http:', 'https:')"/>
<xsl:variable name="shortSpec" select="replace(@spec, '40$', '')"/>

<xsl:choose>
<xsl:when test="not($termdef)">
Expand Down Expand Up @@ -1035,7 +1036,7 @@
</xsl:choose>
<sup>
<small>
<xsl:value-of select="@spec"/>
<xsl:value-of select="$shortSpec"/>
</small>
</sup>
</xsl:when>
Expand All @@ -1052,7 +1053,7 @@
</xsl:choose>
<sup>
<small>
<xsl:value-of select="@spec"/>
<xsl:value-of select="$shortSpec"/>
</small>
</sup>
</xsl:otherwise>
Expand Down

0 comments on commit d3a0d6e

Please sign in to comment.