Changeset 2762 for rfc2629xslt/rfc2629.xslt
- Timestamp:
- 04/10/21 13:39:33 (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
rfc2629xslt/rfc2629.xslt
r2761 r2762 593 593 </xsl:when> 594 594 <xsl:otherwise> 595 <xsl:variable name="uri">596 <!--<xsl:choose>597 <xsl:when test="starts-with(@href,'https://xml2rfc.ietf.org/public/rfc/')">598 <xsl:call-template name="warning">599 <xsl:with-param name="msg">rewriting URI to /xml2rfc.tools.ietf.org for <xsl:value-of select="@href"/> - see in order to avoid broken server's 403 response (see https://mailarchive.ietf.org/arch/msg/xml2rfc/56sDqFVKF0baqdgEjHQtxOUMf4o).</xsl:with-param>600 </xsl:call-template>601 <xsl:value-of select="concat('https://xml2rfc.tools.ietf.org/public/rfc/',substring-after(@href,'https://xml2rfc.ietf.org/public/rfc/'))"/>602 </xsl:when>603 <xsl:otherwise>-->604 <xsl:value-of select="@href"/>605 <!--</xsl:otherwise>606 </xsl:choose>-->607 </xsl:variable>608 595 <xsl:variable name="doc"> 609 <xsl:copy-of select="document( $uri)"/>596 <xsl:copy-of select="document(@href)"/> 610 597 </xsl:variable> 611 598 <xsl:if test="count($doc) = 1"> … … 1016 1003 </xsl:param> 1017 1004 1018 <!-- base URI for include directive when relative reference does not resolve for Inte tnet Drafts -->1005 <!-- base URI for include directive when relative reference does not resolve for Internet Drafts --> 1019 1006 <xsl:param name="xml2rfc-ext-internet-draft-reference-base-uri"> 1020 1007 <xsl:call-template name="parse-pis"> … … 1101 1088 <xsl:with-param name="nodes" select="/processing-instruction('rfc-ext')"/> 1102 1089 <xsl:with-param name="attr" select="'diff-uri'"/> 1103 <xsl:with-param name="default">https:// tools.ietf.org/rfcdiff?url2={internet-draft}</xsl:with-param>1090 <xsl:with-param name="default">https://www.ietf.org/rfcdiff?url2={internet-draft}</xsl:with-param> 1104 1091 </xsl:call-template> 1105 1092 </xsl:param> … … 1435 1422 <eref> 1436 1423 <xsl:choose> 1437 <xsl:when test="$pub-yearmonth >= 201606 or ($rfcno=7846 or $rfcno=7865 or $rfcno=7866 or $rfcno=7873 or $rfcno=7879 or $rfcno=7892)"><xsl:attribute name="target">https:// tools.ietf.org/html/rfc7841#section-2</xsl:attribute>Section 2 of RFC 7841</xsl:when>1438 <xsl:otherwise><xsl:attribute name="target">https:// tools.ietf.org/html/rfc5741#section-2</xsl:attribute>Section 2 of RFC 5741</xsl:otherwise>1424 <xsl:when test="$pub-yearmonth >= 201606 or ($rfcno=7846 or $rfcno=7865 or $rfcno=7866 or $rfcno=7873 or $rfcno=7879 or $rfcno=7892)"><xsl:attribute name="target">https://www.rfc-editor.org/rfc/rfc7841.html#section-2</xsl:attribute>Section 2 of RFC 7841</xsl:when> 1425 <xsl:otherwise><xsl:attribute name="target">https://www.rfc-editor.org/rfc/rfc5741.html#section-2</xsl:attribute>Section 2 of RFC 5741</xsl:otherwise> 1439 1426 </xsl:choose> 1440 1427 </eref> … … 1690 1677 <xsl:template match="artset"> 1691 1678 <xsl:call-template name="check-no-text-content"/> 1692 <!-- see https:// tools.ietf.org/html/draft-levkowetz-xml2rfc-v3-implementation-notes-08#section-3.1.1 -->1679 <!-- see https://datatracker.ietf.org/doc/html/draft-levkowetz-xml2rfc-v3-implementation-notes-12#section-3.1.1 --> 1693 1680 <xsl:choose> 1694 1681 <xsl:when test="artwork[svg:svg or normalize-space(.)='' or @src!='']"> … … 1713 1700 1714 1701 <xsl:template match="artwork|sourcecode"> 1702 <xsl:call-template name="insert-errata"/> 1715 1703 <xsl:if test="not(ancestor::ed:del) and $xml2rfc-ext-parse-xml-in-artwork='yes' and function-available('myns:parseXml')" use-when="function-available('myns:parseXml')"> 1716 1704 <xsl:if test="contains(.,'<?xml')"> … … 2720 2708 </xsl:when> 2721 2709 <xsl:otherwise> 2722 <xsl:if test="*[not(self::postalLine )]">2710 <xsl:if test="*[not(self::postalLine or self::country)]"> 2723 2711 <xsl:call-template name="error"> 2724 <xsl:with-param name="msg">It is not allowed to mix postalLine with other elements ; these will be ignored.</xsl:with-param>2712 <xsl:with-param name="msg">It is not allowed to mix postalLine with other elements except country; these will be ignored.</xsl:with-param> 2725 2713 </xsl:call-template> 2726 2714 </xsl:if> 2727 2715 <xsl:for-each select="postalLine"> 2716 <xsl:call-template name="emit-postal-line"> 2717 <xsl:with-param name="value"> 2718 <xsl:call-template name="extract-normalized"> 2719 <xsl:with-param name="ascii" select="$ascii"/> 2720 </xsl:call-template> 2721 </xsl:with-param> 2722 </xsl:call-template> 2723 </xsl:for-each> 2724 <xsl:for-each select="country"> 2725 <xsl:if test="following-sibling::postalLine"> 2726 <xsl:call-template name="error"> 2727 <xsl:with-param name="msg">When combined with postalLine, country needs to be last.</xsl:with-param> 2728 </xsl:call-template> 2729 </xsl:if> 2728 2730 <xsl:call-template name="emit-postal-line"> 2729 2731 <xsl:with-param name="value"> … … 3623 3625 3624 3626 <xsl:template match="ul"> 3627 <xsl:call-template name="insert-errata"/> 3625 3628 <div> 3626 3629 <xsl:call-template name="insertInsDelClass"/> … … 4038 4041 </xsl:variable> 4039 4042 4043 <xsl:variable name="before-dot"> 4044 <xsl:choose> 4045 <xsl:when test="contains($sec,'.')"> 4046 <xsl:value-of select="substring-before($sec,'.')"/> 4047 </xsl:when> 4048 <xsl:otherwise> 4049 <xsl:value-of select="$sec"/> 4050 </xsl:otherwise> 4051 </xsl:choose> 4052 </xsl:variable> 4053 <xsl:variable name="after-dot" select="substring-after($sec,'.')"/> 4054 <xsl:variable name="is-section" select="translate($sec,'.0123456789','')=''"/> 4055 <xsl:variable name="is-appendix" select="not($is-section) and translate($before-dot,$ucase,'')='' and translate($after-dot,'.0123456789','')=''"/> 4056 4040 4057 <xsl:choose> 4041 4058 <xsl:when test="$ref and $bib/x:source/@href and $bib/x:source/@basename and $ref/@x:rel"> … … 4084 4101 <xsl:if test="$ref and $sec!='' and $rfcUrlFragSection and $rfcUrlFragAppendix"> 4085 4102 <xsl:choose> 4086 <xsl:when test="translate(substring($sec,1,1),$ucase,'')=''"> 4103 <xsl:when test="$is-section"> 4104 <xsl:value-of select="concat('#',$rfcUrlFragSection,$sec)"/> 4105 </xsl:when> 4106 <xsl:when test="$is-appendix"> 4087 4107 <xsl:value-of select="concat('#',$rfcUrlFragAppendix,$sec)"/> 4088 4108 </xsl:when> 4089 4109 <xsl:otherwise> 4090 <xsl:value-of select="concat('#',$rfcUrlFragSection,$sec)"/> 4110 <xsl:call-template name="error"> 4111 <xsl:with-param name="msg" select="concat('cannot compute anchor for ',$sec,' of ',$bib/@anchor)"/> 4112 <xsl:with-param name="inline" select="'no'"/> 4113 </xsl:call-template> 4091 4114 </xsl:otherwise> 4092 4115 </xsl:choose> … … 4103 4126 <xsl:if test="$ref and $sec!='' and $internetDraftUrlFragSection and $internetDraftUrlFragAppendix"> 4104 4127 <xsl:choose> 4105 <xsl:when test="translate(substring($sec,1,1),$ucase,'')=''"> 4128 <xsl:when test="$is-section"> 4129 <xsl:value-of select="concat('#',$internetDraftUrlFragSection,$sec)"/> 4130 </xsl:when> 4131 <xsl:when test="$is-appendix"> 4106 4132 <xsl:value-of select="concat('#',$internetDraftUrlFragAppendix,$sec)"/> 4107 4133 </xsl:when> 4108 4134 <xsl:otherwise> 4109 <xsl:value-of select="concat('#',$internetDraftUrlFragSection,$sec)"/> 4135 <xsl:call-template name="error"> 4136 <xsl:with-param name="msg" select="concat('cannot compute anchor for ',$sec,' of ',$bib/@anchor)"/> 4137 <xsl:with-param name="inline" select="'no'"/> 4138 </xsl:call-template> 4110 4139 </xsl:otherwise> 4111 4140 </xsl:choose> … … 4119 4148 <xsl:if test="$ref and $sec!='' and $rfcUrlFragSection and $rfcUrlFragAppendix"> 4120 4149 <xsl:choose> 4121 <xsl:when test="translate(substring($sec,1,1),$ucase,'')=''"> 4150 <xsl:when test="$is-section"> 4151 <xsl:value-of select="concat('#',$rfcUrlFragSection,$sec)"/> 4152 </xsl:when> 4153 <xsl:when test="$is-appendix"> 4122 4154 <xsl:value-of select="concat('#',$rfcUrlFragAppendix,$sec)"/> 4123 4155 </xsl:when> 4124 4156 <xsl:otherwise> 4125 <xsl:value-of select="concat('#',$rfcUrlFragSection,$sec)"/> 4157 <xsl:call-template name="error"> 4158 <xsl:with-param name="msg" select="concat('cannot compute anchor for ',$sec,' of ',$bib/@anchor)"/> 4159 <xsl:with-param name="inline" select="'no'"/> 4160 </xsl:call-template> 4126 4161 </xsl:otherwise> 4127 4162 </xsl:choose> … … 4138 4173 <xsl:if test="$ref and $sec!='' and $internetDraftUrlFragSection and $internetDraftUrlFragAppendix"> 4139 4174 <xsl:choose> 4140 <xsl:when test="translate(substring($sec,1,1),$ucase,'')=''"> 4175 <xsl:when test="$is-section"> 4176 <xsl:value-of select="concat('#',$internetDraftUrlFragSection,$sec)"/> 4177 </xsl:when> 4178 <xsl:when test="$is-appendix"> 4141 4179 <xsl:value-of select="concat('#',$internetDraftUrlFragAppendix,$sec)"/> 4142 4180 </xsl:when> 4143 4181 <xsl:otherwise> 4144 <xsl:value-of select="concat('#',$internetDraftUrlFragSection,$sec)"/> 4182 <xsl:call-template name="error"> 4183 <xsl:with-param name="msg" select="concat('cannot compute anchor for ',$sec,' of ',$bib/@anchor)"/> 4184 <xsl:with-param name="inline" select="'no'"/> 4185 </xsl:call-template> 4145 4186 </xsl:otherwise> 4146 4187 </xsl:choose> … … 4243 4284 <xsl:choose> 4244 4285 <xsl:when test="starts-with($bib/@target,'http://www.rfc-editor.org/info/rfc') or starts-with($bib/@target,'https://www.rfc-editor.org/info/rfc') and $ref and ($ref/@x:sec or $ref/@x:rel or $ref/@section or $ref/@relative)"> 4245 <!--ignored, use tools.ietf.org link instead -->4286 <!--ignored, use ietf.org link instead --> 4246 4287 </xsl:when> 4247 4288 <xsl:otherwise> … … 4502 4543 </xsl:when> 4503 4544 <xsl:when test="/rfc/@version >= 3 and $pub-yearmonth >= 201910"> 4504 <!-- https:// tools.ietf.org/html/draft-flanagan-7322bis-04#section-4.8.6.3 -->4545 <!-- https://datatracker.ietf.org/doc/html/draft-flanagan-7322bis-07#section-4.8.6.3 --> 4505 4546 <xsl:call-template name="emit-link"> 4506 4547 <xsl:with-param name="target" select="$uri"/> … … 5388 5429 </xsl:variable> 5389 5430 5431 <xsl:call-template name="insert-errata"/> 5432 5390 5433 <div> 5391 5434 <xsl:if test="not(ancestor::list) and not(ancestor::table)"> … … 5765 5808 5766 5809 <!-- errata handling --> 5767 <xsl:template name="insert-errat a">5768 <xsl:param name=" section"/>5769 <xsl: variable name="es" select="$errata-parsed[section=$section or (not(section) and $section='1')]"/>5810 <xsl:template name="insert-erratum"> 5811 <xsl:param name="es"/> 5812 <xsl:param name="sec"/> 5770 5813 <xsl:if test="$es"> 5771 5814 <aside class="{$css-erratum}"> 5772 5815 <xsl:for-each select="$es"> 5773 5816 <xsl:sort select="@eid" data-type="number"/> 5774 <div> 5817 <xsl:variable name="pf"> 5818 <xsl:variable name="entry" select="section[.=$sec]"/> 5819 <xsl:if test="count($entry/preceding-sibling::section)!=0"> 5820 <xsl:text>.</xsl:text> 5821 <xsl:value-of select="1 + count($entry/preceding-sibling::section)"/> 5822 </xsl:if> 5823 </xsl:variable> 5824 <div id="{$anchor-pref}erratum.{@eid}{$pf}"> 5775 5825 <xsl:variable name="tooltip"> 5776 5826 <xsl:value-of select="@reported-by"/> … … 5795 5845 </aside> 5796 5846 </xsl:if> 5847 </xsl:template> 5848 5849 <xsl:template name="insert-errata"> 5850 <xsl:param name="section"> 5851 <xsl:call-template name="get-section-number"/> 5852 </xsl:param> 5853 <xsl:variable name="match-para" select="self::artwork or self::sourcecode or self::t or self::ul"/> 5854 <xsl:choose> 5855 <xsl:when test="$match-para"> 5856 <xsl:variable name="p"> 5857 <xsl:call-template name="get-paragraph-number"> 5858 <xsl:with-param name="delim">-</xsl:with-param> 5859 </xsl:call-template> 5860 </xsl:variable> 5861 <xsl:variable name="es" select="$errata-parsed[section[@part=concat('section-',$p) or @part=concat('appendix-',$p)]]"/> 5862 <xsl:if test="$p!='' and $es"> 5863 <xsl:call-template name="insert-erratum"> 5864 <xsl:with-param name="es" select="$es"/> 5865 <xsl:with-param name="sec" select="$section"/> 5866 </xsl:call-template> 5867 </xsl:if> 5868 </xsl:when> 5869 <xsl:otherwise> 5870 <xsl:variable name="es" select="$errata-parsed[section=$section or (not(section) and $section='1')]"/> 5871 <xsl:call-template name="insert-erratum"> 5872 <xsl:with-param name="es" select="$es[not(section/@part)]"/> 5873 <xsl:with-param name="sec" select="$section"/> 5874 </xsl:call-template> 5875 </xsl:otherwise> 5876 </xsl:choose> 5797 5877 </xsl:template> 5798 5878 … … 6539 6619 6540 6620 <xsl:variable name="secterm"> 6621 <xsl:variable name="before-dot"> 6622 <xsl:choose> 6623 <xsl:when test="contains($sec,'.')"> 6624 <xsl:value-of select="substring-before($sec,'.')"/> 6625 </xsl:when> 6626 <xsl:otherwise> 6627 <xsl:value-of select="$sec"/> 6628 </xsl:otherwise> 6629 </xsl:choose> 6630 </xsl:variable> 6631 <xsl:variable name="after-dot" select="substring-after($sec,'.')"/> 6541 6632 <xsl:choose> 6542 < !-- starts with letter or unnumbered? -->6543 <xsl:when test=" translate(substring($sec,1,1),$ucase,'')=''or starts-with($tsec,'A@')">Appendix</xsl:when>6544 <xsl:otherwise> Section</xsl:otherwise>6633 <xsl:when test="translate($sec,'.0123456789','')='' or starts-with($tsec,'S@')">Section</xsl:when> 6634 <xsl:when test="(translate($before-dot,$ucase,'')='' and translate($after-dot,'.0123456789','')='') or starts-with($tsec,'A@')">Appendix</xsl:when> 6635 <xsl:otherwise>Part</xsl:otherwise> 6545 6636 </xsl:choose> 6546 6637 </xsl:variable> … … 6639 6730 <!-- nothing to do here --> 6640 6731 </xsl:when> 6641 <xsl:when test="$is-xref and $from/@format='counter' ">6732 <xsl:when test="$is-xref and $from/@format='counter' and $sec=''"> 6642 6733 <xsl:call-template name="error"> 6643 6734 <xsl:with-param name="inline">no</xsl:with-param> 6644 6735 <xsl:with-param name="msg">xref to reference with format='counter' not allowed</xsl:with-param> 6736 <xsl:with-param name="node" select="$from"/> 6645 6737 </xsl:call-template> 6646 6738 <!-- remove brackets --> … … 7023 7115 <xsl:variable name="rallowed"> 7024 7116 <xsl:if test="$pub-yearmonth < 201509"> 7025 <ed:v> Applications</ed:v>7117 <ed:v>applications</ed:v> 7026 7118 <ed:v>app</ed:v> 7027 7119 </xsl:if> 7028 7120 <xsl:if test="$pub-yearmonth > 201505"> 7029 <ed:v> Applications and Real-Time</ed:v>7121 <ed:v>applications and real-time</ed:v> 7030 7122 <ed:v>art</ed:v> 7031 7123 </xsl:if> 7032 <ed:v> General</ed:v>7124 <ed:v>general</ed:v> 7033 7125 <ed:v>gen</ed:v> 7034 <ed:v> Internet</ed:v>7126 <ed:v>internet</ed:v> 7035 7127 <ed:v>int</ed:v> 7036 <ed:v> Operations and Management</ed:v>7128 <ed:v>operations and management</ed:v> 7037 7129 <ed:v>ops</ed:v> 7038 7130 <xsl:if test="$pub-yearmonth < 201509"> 7039 <ed:v> Real-time Applications and Infrastructure</ed:v>7131 <ed:v>real-time applications and infrastructure</ed:v> 7040 7132 <ed:v>rai</ed:v> 7041 7133 </xsl:if> 7042 <ed:v> Routing</ed:v>7134 <ed:v>routing</ed:v> 7043 7135 <ed:v>rtg</ed:v> 7044 <ed:v> Security</ed:v>7136 <ed:v>security</ed:v> 7045 7137 <ed:v>sec</ed:v> 7046 <ed:v> Transport</ed:v>7138 <ed:v>transport</ed:v> 7047 7139 <ed:v>tsv</ed:v> 7048 7140 </xsl:variable> 7049 7141 <xsl:variable name="allowed" select="exslt:node-set($rallowed)"/> 7050 7142 <xsl:choose> 7051 <xsl:when test="$allowed/ed:v= $area">7143 <xsl:when test="$allowed/ed:v=translate($area,$ucase,$lcase)"> 7052 7144 <!-- ok --> 7053 7145 </xsl:when> … … 7578 7670 </xsl:when> 7579 7671 <xsl:otherwise> 7580 <!-- <http ://tools.ietf.org/html/rfc2026#section-10.4> -->7672 <!-- <https://www.rfc-editor.org/rfc/rfc2026.html#section-10.4> --> 7581 7673 <t> 7582 7674 Copyright © The Internet Society (<xsl:value-of select="$xml2rfc-ext-pub-year" />). All Rights Reserved. … … 8211 8303 window.location.hash = mapped; 8212 8304 } else if (fragid.indexOf("section-") == 0) { 8213 window.location.hash = prefix + "section." + fragid.substring(8) ;8305 window.location.hash = prefix + "section." + fragid.substring(8).replace("-",".p."); 8214 8306 } else if (fragid.indexOf("appendix-") == 0) { 8215 window.location.hash = prefix + "section." + fragid.substring(9) ;8307 window.location.hash = prefix + "section." + fragid.substring(9).replace("-",".p."); 8216 8308 } else if (fragid.indexOf("s-") == 0) { 8217 8309 var postfix = fragid.substring(2); … … 8219 8311 window.location.hash = prefix + postfix; 8220 8312 } else if (postfix.startsWith("note-")) { 8221 window.location.hash = prefix + "note." + postfix.substring(5) ;8313 window.location.hash = prefix + "note." + postfix.substring(5).replace("-",".p."); 8222 8314 } else { 8223 window.location.hash = prefix + "section." + postfix ;8315 window.location.hash = prefix + "section." + postfix.replace("-",".p."); 8224 8316 } 8225 8317 } else if (fragid.indexOf("p-") == 0) { … … 8359 8451 dl > dd > dl { 8360 8452 margin-top: 0.5em; 8453 } 8454 dt > span { 8455 line-height: 0; 8456 } 8457 dd > span { 8458 line-height: 0; 8361 8459 } 8362 8460 ul.empty {<!-- spacing between two entries in definition lists --> … … 10326 10424 <xsl:text>Figures</xsl:text> 10327 10425 <ul> 10328 <xsl:for-each select="//figure [@title!='' or @anchor!='' or name]">10426 <xsl:for-each select="//figure"> 10329 10427 <xsl:variable name="n"><xsl:call-template name="get-figure-number"/></xsl:variable> 10330 10428 <xsl:variable name="title"> … … 10619 10717 10620 10718 <xsl:template name="get-paragraph-number"> 10719 <xsl:param name="delim">.p.</xsl:param> 10621 10720 <xsl:choose> 10622 10721 <!-- inside artset --> … … 10644 10743 <xsl:when test="ancestor::section"> 10645 10744 <!-- get section number of ancestor section element, then add t number --> 10646 <xsl:for-each select="ancestor::section[1]"><xsl:call-template name="get-section-number" /> .p.</xsl:for-each>10745 <xsl:for-each select="ancestor::section[1]"><xsl:call-template name="get-section-number" /><xsl:value-of select="$delim"/></xsl:for-each> 10647 10746 <xsl:variable name="b"><xsl:number count="artset|artwork|aside|blockquote|dl|ol|sourcecode|t|ul|x:blockquote|x:note"/></xsl:variable> 10648 10747 <xsl:choose> … … 10656 10755 <xsl:when test="ancestor::note"> 10657 10756 <!-- get section number of ancestor note element, then add t number --> 10658 <xsl:for-each select="ancestor::note[1]"><xsl:call-template name="get-section-number" /> .p.</xsl:for-each>10757 <xsl:for-each select="ancestor::note[1]"><xsl:call-template name="get-section-number" /><xsl:value-of select="$delim"/></xsl:for-each> 10659 10758 <xsl:variable name="b"><xsl:number count="artset|artwork|aside|blockquote|dl|ol|sourcecode|t|ul|x:blockquote|x:note"/></xsl:variable> 10660 10759 <xsl:choose> … … 12194 12293 <xsl:text>http://greenbytes.de/tech/webdav/rfc2629.xslt, </xsl:text> 12195 12294 <!-- when RCS keyword substitution in place, add version info --> 12196 <xsl:if test="contains('$Revision: 1.1 398$',':')">12197 <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.1 398$', 'Revision: '),'$','')),', ')" />12295 <xsl:if test="contains('$Revision: 1.1421 $',':')"> 12296 <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.1421 $', 'Revision: '),'$','')),', ')" /> 12198 12297 </xsl:if> 12199 <xsl:if test="contains('$Date: 2021/ 06/06 09:33:18$',':')">12200 <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2021/ 06/06 09:33:18$', 'Date: '),'$','')),', ')" />12298 <xsl:if test="contains('$Date: 2021/10/04 11:14:10 $',':')"> 12299 <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2021/10/04 11:14:10 $', 'Date: '),'$','')),', ')" /> 12201 12300 </xsl:if> 12202 12301 <xsl:variable name="product" select="normalize-space(concat(system-property('xsl:product-name'),' ',system-property('xsl:product-version')))"/>
Note: See TracChangeset
for help on using the changeset viewer.