Changeset 754 for rfc2629xslt/rfc2629toXHTML.xslt
- Timestamp:
- 31/01/10 23:09:48 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
rfc2629xslt/rfc2629toXHTML.xslt
r741 r754 242 242 <xsl:with-param name="nodes" select="/processing-instruction('rfc-ext')"/> 243 243 <xsl:with-param name="attr" select="'duplex'"/> 244 <xsl:with-param name="default" select="'no'"/>245 </xsl:call-template>246 </xsl:param>247 248 <!-- experimental support for RFC 5741, work in progress -->249 250 <xsl:param name="xml2rfc-ext-hab">251 <xsl:call-template name="parse-pis">252 <xsl:with-param name="nodes" select="/processing-instruction('rfc-ext')"/>253 <xsl:with-param name="attr" select="'h-a-b'"/>254 244 <xsl:with-param name="default" select="'no'"/> 255 245 </xsl:call-template> … … 370 360 </xsl:variable> 371 361 362 <xsl:variable name="rfc-boilerplate"> 363 <xsl:choose> 364 <!-- RFC boilerplate as defined in RFC 5741, and deployed end of Dec 2009 --> 365 <xsl:when test="$pub-yearmonth >= 201001 or ($rfcno=5741 or $rfcno=5742 or $rfcno=5743)">2010</xsl:when> 366 <xsl:when test="$xml2rfc-ext-tlp='4'">2010</xsl:when> 367 <xsl:otherwise/> 368 </xsl:choose> 369 </xsl:variable> 370 371 <xsl:variable name="id-boilerplate"> 372 <xsl:choose> 373 <!-- ID boilerplate approved by IESG on Jan 14 2010--> 374 <xsl:when test="$pub-yearmonth >= 201004">2010</xsl:when> 375 <xsl:otherwise/> 376 </xsl:choose> 377 </xsl:variable> 378 372 379 <xsl:variable name="ipr-rfc4748" select="( $ipr-rfc3667 and ( $rfcno >= 4715 and ( $rfcno != 4718 and $rfcno != 4735 and $rfcno != 4749 )) or ( $rfcno=4578 or $rfcno=4582 or $rfcno=4583 or $rfcno=4628 or $rfcno=4629 or $rfcno=4639 or $rfcno=4651 or $rfcno=4682 or $rfcno=4684 or $rfcno=4695 or $rfcno=4696 ) or ( not(/rfc/@number) and $pub-yearmonth >= 200611) )"/> 373 380 … … 381 388 for IDs, and around 2009-09 for RFCs--> 382 389 <xsl:variable name="ipr-2009-09" select="( ( not(/rfc/@number) and $pub-yearmonth >= 200911 ) or ( /rfc/@number and $pub-yearmonth >= 200909 and $rfcno!=5582 and $rfcno!=5621 and $rfcno!=5632 and $rfcno!=5645 and $rfcno!=5646 and $rfcno!=5681 ) )"/> 390 391 <!-- this makes the Jan 2010 TLP text depend on the tlp ext PI 392 for IDs, and around 2010-01 for RFCs--> 393 <xsl:variable name="ipr-2010-01" select="( ( not(/rfc/@number) and $xml2rfc-ext-tlp='4' ) or ( /rfc/@number and ($pub-yearmonth >= 201001 or $rfcno=5741 or $rfcno=5742 or $rfcno=5743) ) )"/> 383 394 384 395 <!-- see http://mailman.rfc-editor.org/pipermail/rfc-interest/2009-June/001373.html --> … … 400 411 <!-- does the document contain edits? --> 401 412 <xsl:variable name="has-edits" select="//ed:ins | //ed:del | //ed:replace"/> 402 403 <!-- Templates for the various elements of rfc2629.dtd -->404 413 405 414 <xsl:template match="text()[not(ancestor::artwork)]"> 406 <xsl:variable name="starts-with-ws" select="translate(substring(.,1,1),'	

 ','')"/> 407 <xsl:variable name="ends-with-ws" select="translate(substring(.,string-length(.),1),'	

 ','')"/> 415 <xsl:variable name="ws" select="'	

 '"/> 416 <xsl:variable name="starts-with-ws" select="translate(substring(.,1,1),$ws,'')"/> 417 <xsl:variable name="ends-with-ws" select="translate(substring(.,string-length(.),1),$ws,'')"/> 408 418 <!--<xsl:message> Orig: "<xsl:value-of select="."/>"</xsl:message> 409 419 <xsl:message>Start: "<xsl:value-of select="$starts-with-ws"/>"</xsl:message> … … 764 774 </xsl:template> 765 775 766 <xsl:template match="back"> 776 <!-- this is a named template because <back> may be absent --> 777 <xsl:template name="back"> 767 778 768 779 <!-- add editorial comments --> … … 777 788 778 789 <!-- add all other top-level sections under <back> --> 779 <xsl:apply-templates select=" *[not(self::references) and not(self::ed:replace and .//references)]"/>790 <xsl:apply-templates select="back/*[not(self::references) and not(self::ed:replace and .//references)]"/> 780 791 781 792 <!-- insert the index if index entries exist --> … … 1575 1586 <link rel="Author" href="#{$anchor-prefix}.authors"/> 1576 1587 <xsl:if test="$xml2rfc-private=''"> 1577 <link rel="Copyright" href="#{$anchor-prefix}.copyright"/> 1588 <xsl:choose> 1589 <xsl:when test="$no-copylong"> 1590 <link rel="Copyright" href="#{$anchor-prefix}.copyrightnotice"/> 1591 </xsl:when> 1592 <xsl:otherwise> 1593 <link rel="Copyright" href="#{$anchor-prefix}.copyright"/> 1594 </xsl:otherwise> 1595 </xsl:choose> 1578 1596 </xsl:if> 1579 1597 <xsl:if test="$has-index"> … … 1613 1631 <xsl:if test="$xml2rfc-ext-support-rfc2731!='no'"> 1614 1632 <!-- Dublin Core Metadata --> 1615 <link rel="schema. DC" href="http://purl.org/dc/elements/1.1/"/>1633 <link rel="schema.dct" href="http://purl.org/dc/terms/"/> 1616 1634 1617 1635 <!-- DC creator, see RFC2731 --> … … 1620 1638 <xsl:call-template name="format-initials"/> 1621 1639 </xsl:variable> 1622 <meta name=" DC.Creator" content="{concat(@surname,', ',$initials)}"/>1640 <meta name="dct.creator" content="{concat(@surname,', ',$initials)}"/> 1623 1641 </xsl:for-each> 1624 1642 … … 1626 1644 <xsl:choose> 1627 1645 <xsl:when test="@number"> 1628 <meta name=" DC.Identifier" content="urn:ietf:rfc:{@number}"/>1646 <meta name="dct.identifier" content="urn:ietf:rfc:{@number}"/> 1629 1647 </xsl:when> 1630 1648 <xsl:when test="@docName"> 1631 <meta name=" DC.Identifier" content="urn:ietf:id:{@docName}"/>1649 <meta name="dct.identifier" content="urn:ietf:id:{@docName}"/> 1632 1650 </xsl:when> 1633 1651 <xsl:otherwise/> 1634 1652 </xsl:choose> 1635 <meta name=" DC.Date.Issued" scheme="ISO8601">1653 <meta name="dct.issued" scheme="ISO8601"> 1636 1654 <xsl:attribute name="content"> 1637 1655 <xsl:value-of select="concat($xml2rfc-ext-pub-year,'-',$pub-month-numeric)"/> … … 1650 1668 1651 1669 <xsl:if test="front/abstract"> 1652 <meta name=" DC.Description.Abstract" content="{normalize-space(front/abstract)}"/>1670 <meta name="dct.abstract" content="{normalize-space(front/abstract)}"/> 1653 1671 </xsl:if> 1654 1672 1655 1673 <xsl:if test="@number"> 1656 <meta name=" DC.isPartOf" content="urn:issn:2070-1721"/>1674 <meta name="dct.isPartOf" content="urn:issn:2070-1721"/> 1657 1675 </xsl:if> 1658 1676 1659 1677 </xsl:if> 1660 1678 1661 <!-- this replicates dc .description.abstract, but is used by Google & friends -->1679 <!-- this replicates dct.abstract, but is used by Google & friends --> 1662 1680 <xsl:if test="front/abstract"> 1663 1681 <meta name="description" content="{normalize-space(front/abstract)}"/> … … 1671 1689 <xsl:apply-templates select="front"/> 1672 1690 <xsl:apply-templates select="middle"/> 1673 <xsl: apply-templates select="back"/>1691 <xsl:call-template name="back"/> 1674 1692 </body> 1675 1693 </html> … … 2387 2405 </xsl:when> 2388 2406 <xsl:otherwise> 2407 <xsl:if test="starts-with(/rfc/@docName,'draft-ietf-') and not(/rfc/front/workgroup)"> 2408 <xsl:call-template name="info"> 2409 <xsl:with-param name="inline" select="'no'"/> 2410 <xsl:with-param name="msg">WG submissions should include a /rfc/front/workgroup element</xsl:with-param> 2411 </xsl:call-template> 2412 </xsl:if> 2389 2413 <myns:item>Network Working Group</myns:item> 2390 2414 </xsl:otherwise> … … 2392 2416 <myns:item> 2393 2417 <xsl:choose> 2394 <xsl:when test="/rfc/@ipr and not(/rfc/@number)">Internet 2418 <xsl:when test="/rfc/@ipr and not(/rfc/@number)">Internet-Draft</xsl:when> 2395 2419 <xsl:otherwise>Request for Comments: <xsl:value-of select="/rfc/@number"/></xsl:otherwise> 2396 2420 </xsl:choose> 2397 2421 </myns:item> 2398 <xsl:if test="/rfc/@obsoletes and /rfc/@obsoletes!=''">2422 <xsl:if test="/rfc/@obsoletes!=''"> 2399 2423 <myns:item> 2400 2424 <xsl:text>Obsoletes: </xsl:text> … … 2415 2439 </myns:item> 2416 2440 </xsl:if> 2417 <xsl:if test="/rfc/@updates and /rfc/@updates!=''">2441 <xsl:if test="/rfc/@updates!=''"> 2418 2442 <myns:item> 2419 2443 <xsl:text>Updates: </xsl:text> … … 2712 2736 <t> 2713 2737 This document is subject to the rights, licenses and restrictions 2714 contained in BCP 78<xsl:if test="$submissionType='independent'"> and at <eref target="http://www.rfc-editor.org/copyright.html" /></xsl:if>, and except as set forth therein, the authors2738 contained in BCP 78<xsl:if test="$submissionType='independent'"> and at <eref target="http://www.rfc-editor.org/copyright.html">http://www.rfc-editor.org/copyright.html</eref></xsl:if>, and except as set forth therein, the authors 2715 2739 retain all their rights. 2716 2740 </t> … … 2749 2773 <t> 2750 2774 The limited permissions granted above are perpetual and will not be 2751 revoked by the Internet Society or its successors or assign ees.2775 revoked by the Internet Society or its successors or assigns. 2752 2776 </t> 2753 2777 <t> … … 2782 2806 of such proprietary rights by implementers or users of this 2783 2807 specification can be obtained from the IETF on-line IPR repository 2784 at <eref target="http://www.ietf.org/ipr" />.2808 at <eref target="http://www.ietf.org/ipr">http://www.ietf.org/ipr</eref>. 2785 2809 </t> 2786 2810 <t> … … 3857 3881 </xsl:when> 3858 3882 3859 <!-- as of Feb 2010 -->3860 <xsl:when test="$ xml2rfc-ext-tlp='4'and (/rfc/@ipr = 'trust200902' or /rfc/@ipr = 'noModificationTrust200902' or /rfc/@ipr = 'noDerivativesTrust200902' or /rfc/@ipr = 'pre5378Trust200902')">3883 <!-- as of Jan 2010, TLP 4.0 --> 3884 <xsl:when test="$ipr-2010-01 and (/rfc/@ipr = 'trust200902' or /rfc/@ipr = 'noModificationTrust200902' or /rfc/@ipr = 'noDerivativesTrust200902' or /rfc/@ipr = 'pre5378Trust200902')"> 3861 3885 This Internet-Draft is submitted in full conformance with 3862 3886 the provisions of BCP 78 and BCP 79. … … 3901 3925 </xsl:choose> 3902 3926 </t> 3903 <t> 3904 Internet-Drafts are working documents of the Internet Engineering 3905 Task Force (IETF), its areas, and its working groups. 3906 Note that other groups may also distribute working documents as 3907 Internet-Drafts. 3908 </t> 3927 <xsl:choose> 3928 <xsl:when test="$id-boilerplate='2010'"> 3929 <t> 3930 Internet-Drafts are working documents of the Internet Engineering 3931 Task Force (IETF). Note that other groups may also distribute 3932 working documents as Internet-Drafts. The list of current 3933 Internet-Drafts is at <eref target="http://datatracker.ietf.org/drafts/current/">http://datatracker.ietf.org/drafts/current/</eref>. 3934 </t> 3935 </xsl:when> 3936 <xsl:otherwise> 3937 <t> 3938 Internet-Drafts are working documents of the Internet Engineering 3939 Task Force (IETF), its areas, and its working groups. 3940 Note that other groups may also distribute working documents as 3941 Internet-Drafts. 3942 </t> 3943 </xsl:otherwise> 3944 </xsl:choose> 3909 3945 <t> 3910 3946 Internet-Drafts are draft documents valid for a maximum of six months … … 3913 3949 them other than as “work in progress”. 3914 3950 </t> 3915 <t> 3916 The list of current Internet-Drafts can be accessed at 3917 <eref target="http://www.ietf.org/ietf/1id-abstracts.txt"/>. 3918 </t> 3919 <t> 3920 The list of Internet-Draft Shadow Directories can be accessed at 3921 <eref target="http://www.ietf.org/shadow.html"/>. 3922 </t> 3951 <xsl:if test="$id-boilerplate=''"> 3952 <t> 3953 The list of current Internet-Drafts can be accessed at 3954 <eref target="http://www.ietf.org/ietf/1id-abstracts.txt">http://www.ietf.org/ietf/1id-abstracts.txt</eref>. 3955 </t> 3956 <t> 3957 The list of Internet-Draft Shadow Directories can be accessed at 3958 <eref target="http://www.ietf.org/shadow.html">http://www.ietf.org/shadow.html</eref>. 3959 </t> 3960 </xsl:if> 3923 3961 <t> 3924 3962 This Internet-Draft will expire in <xsl:call-template name="expirydate"/>. … … 3926 3964 </xsl:when> 3927 3965 3928 <xsl:when test="/rfc/@category='bcp' and $ xml2rfc-ext-hab='yes'">3966 <xsl:when test="/rfc/@category='bcp' and $rfc-boilerplate='2010'"> 3929 3967 <t> 3930 3968 This memo documents an Internet Best Current Practice. … … 3938 3976 </t> 3939 3977 </xsl:when> 3940 <xsl:when test="/rfc/@category='exp' and $ xml2rfc-ext-hab='yes'">3978 <xsl:when test="/rfc/@category='exp' and $rfc-boilerplate='2010'"> 3941 3979 <t> 3942 3980 This document is not an Internet Standards Track specification; it is … … 3952 3990 </t> 3953 3991 </xsl:when> 3954 <xsl:when test="/rfc/@category='historic' and $ xml2rfc-ext-hab='yes'">3992 <xsl:when test="/rfc/@category='historic' and $rfc-boilerplate='2010'"> 3955 3993 <t> 3956 3994 This document is not an Internet Standards Track specification; it is … … 3965 4003 </t> 3966 4004 </xsl:when> 3967 <xsl:when test="/rfc/@category='std' and $ xml2rfc-ext-hab='yes'">4005 <xsl:when test="/rfc/@category='std' and $rfc-boilerplate='2010'"> 3968 4006 <t> 3969 4007 This is an Internet Standards Track document. … … 3979 4017 </t> 3980 4018 </xsl:when> 3981 <xsl:when test="(/rfc/@category='info' or not(/rfc/@category)) and $ xml2rfc-ext-hab='yes'">4019 <xsl:when test="(/rfc/@category='info' or not(/rfc/@category)) and $rfc-boilerplate='2010'"> 3982 4020 <t> 3983 4021 This document is not an Internet Standards Track specification; it is … … 4004 4042 4005 4043 <!-- 2nd and 3rd paragraph --> 4006 <xsl:if test="$ xml2rfc-ext-hab='yes'">4044 <xsl:if test="$rfc-boilerplate='2010' and /rfc/@number"> 4007 4045 <t> 4008 4046 <xsl:if test="/rfc/@category='exp'"> … … 4114 4152 </t> 4115 4153 <xsl:choose> 4116 <xsl:when test="$ipr-20 09-09 and $xml2rfc-ext-tlp='4'">4154 <xsl:when test="$ipr-2010-01"> 4117 4155 <t> 4118 4156 This document is subject to BCP 78 and the IETF Trust's Legal … … 4266 4304 </xsl:template> 4267 4305 4268 <xsl:template match="back" mode="toc">4306 <xsl:template name="back-toc"> 4269 4307 4270 4308 <xsl:if test="//cref and $xml2rfc-comments='yes' and $xml2rfc-inline!='yes'"> … … 4280 4318 <xsl:apply-templates select="/rfc/front" mode="toc"/> 4281 4319 </xsl:if> 4282 <xsl:apply-templates select=" *[not(self::references)]" mode="toc"/>4320 <xsl:apply-templates select="back/*[not(self::references)]" mode="toc"/> 4283 4321 4284 4322 <!-- insert the index if index entries exist --> … … 4468 4506 4469 4507 <xsl:template match="rfc" mode="toc"> 4470 <xsl:apply-templates select="middle|back" mode="toc"/> 4508 <xsl:apply-templates select="middle" mode="toc"/> 4509 <xsl:call-template name="back-toc"/> 4471 4510 </xsl:template> 4472 4511 … … 4554 4593 <xsl:template name="rfc-or-id-link"> 4555 4594 <xsl:param name="name"/> 4556 <xsl:call-template name="check-front-matter-ref"> 4557 <xsl:with-param name="name" select="$name"/> 4558 </xsl:call-template> 4559 <a xmlns="http://www.w3.org/1999/xhtml"> 4560 <xsl:attribute name="href"> 4561 <xsl:choose> 4562 <xsl:when test="starts-with($name,'draft-')"> 4563 <xsl:value-of select="concat($internetDraftUrlPrefix,$name,$internetDraftUrlPostfix)"/> 4564 </xsl:when> 4565 <xsl:otherwise> 4566 <xsl:value-of select="concat($rfcUrlPrefix,$name,$rfcUrlPostfix)"/> 4567 </xsl:otherwise> 4568 </xsl:choose> 4569 </xsl:attribute> 4570 <xsl:value-of select="$name"/> 4571 </a> 4595 4596 <xsl:choose> 4597 <xsl:when test="starts-with($name,'draft-')"> 4598 <a xmlns="http://www.w3.org/1999/xhtml" href="{concat($internetDraftUrlPrefix,$name,$internetDraftUrlPostfix)}"><xsl:value-of select="$name"/></a> 4599 <xsl:call-template name="check-front-matter-ref"> 4600 <xsl:with-param name="name" select="$name"/> 4601 </xsl:call-template> 4602 </xsl:when> 4603 <xsl:when test="number($name)=$name"> 4604 <a xmlns="http://www.w3.org/1999/xhtml" href="{concat($rfcUrlPrefix,$name,$rfcUrlPostfix)}"><xsl:value-of select="$name"/></a> 4605 <xsl:call-template name="check-front-matter-ref"> 4606 <xsl:with-param name="name" select="$name"/> 4607 </xsl:call-template> 4608 </xsl:when> 4609 <xsl:otherwise> 4610 <xsl:value-of select="$name"/> 4611 <xsl:call-template name="warning"> 4612 <xsl:with-param name="inline" select="'no'"/> 4613 <xsl:with-param name="msg" select="concat('In metadata obsoletes/updates, RFC number of draft name is expected - found: ',$name)"/> 4614 </xsl:call-template> 4615 </xsl:otherwise> 4616 </xsl:choose> 4572 4617 </xsl:template> 4573 4618 … … 4642 4687 <xsl:when test="contains($list,',')"> 4643 4688 <xsl:variable name="rfcNo" select="substring-before($list,',')"/> 4644 <meta xmlns="http://www.w3.org/1999/xhtml" name=" DC.Relation.Replaces" content="urn:ietf:rfc:{$rfcNo}"/>4689 <meta xmlns="http://www.w3.org/1999/xhtml" name="dct.replaces" content="urn:ietf:rfc:{$rfcNo}"/> 4645 4690 <xsl:call-template name="rfclist-for-dcmeta"> 4646 4691 <xsl:with-param name="list" select="normalize-space(substring-after($list,','))"/> … … 4649 4694 <xsl:otherwise> 4650 4695 <xsl:variable name="rfcNo" select="$list"/> 4651 <meta xmlns="http://www.w3.org/1999/xhtml" name=" DC.Relation.Replaces" content="urn:ietf:rfc:{$rfcNo}"/>4696 <meta xmlns="http://www.w3.org/1999/xhtml" name="dct.replaces" content="urn:ietf:rfc:{$rfcNo}"/> 4652 4697 </xsl:otherwise> 4653 4698 </xsl:choose> … … 4709 4754 <!-- Notes --> 4710 4755 <xsl:template match="x:note"> 4756 <xsl:variable name="p"> 4757 <xsl:call-template name="get-paragraph-number"/> 4758 </xsl:variable> 4759 4711 4760 <div xmlns="http://www.w3.org/1999/xhtml" class="note"> 4761 <xsl:if test="$p!='' and not(ancestor::ed:del) and not(ancestor::ed:ins)"> 4762 <xsl:attribute name="id"><xsl:value-of select="$anchor-prefix"/>.section.<xsl:value-of select="$p"/></xsl:attribute> 4763 </xsl:if> 4712 4764 <xsl:apply-templates/> 4713 4765 </div> … … 5530 5582 </xsl:template> 5531 5583 5584 <xsl:template name="info"> 5585 <xsl:param name="msg"/> 5586 <xsl:param name="msg2"/> 5587 <xsl:param name="inline"/> 5588 <xsl:call-template name="emit-message"> 5589 <xsl:with-param name="level">INFO</xsl:with-param> 5590 <xsl:with-param name="msg" select="$msg"/> 5591 <xsl:with-param name="msg2" select="$msg2"/> 5592 <xsl:with-param name="inline" select="$inline"/> 5593 </xsl:call-template> 5594 </xsl:template> 5595 5532 5596 <xsl:template name="error"> 5533 5597 <xsl:param name="msg"/> … … 5848 5912 <xsl:when test="$xml2rfc-header!=''"><xsl:value-of select="$xml2rfc-header"/></xsl:when> 5849 5913 <xsl:when test="$xml2rfc-private!=''"/> <!-- private draft, header not set --> 5850 <xsl:when test="/rfc/@ipr and not(/rfc/@number)">I NTERNET DRAFT</xsl:when>5914 <xsl:when test="/rfc/@ipr and not(/rfc/@number)">Internet-Draft</xsl:when> 5851 5915 <xsl:otherwise>RFC <xsl:value-of select="/rfc/@number"/></xsl:otherwise> 5852 5916 </xsl:choose> … … 5857 5921 <xsl:text>http://greenbytes.de/tech/webdav/rfc2629.xslt, </xsl:text> 5858 5922 <!-- when RCS keyword substitution in place, add version info --> 5859 <xsl:if test="contains('$Revision: 1. 497$',':')">5860 <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1. 497$', 'Revision: '),'$','')),', ')"/>5923 <xsl:if test="contains('$Revision: 1.508 $',':')"> 5924 <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.508 $', 'Revision: '),'$','')),', ')"/> 5861 5925 </xsl:if> 5862 <xsl:if test="contains('$Date: 20 09-12-30 19:57:37 $',':')">5863 <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 20 09-12-30 19:57:37 $', 'Date: '),'$','')),', ')"/>5926 <xsl:if test="contains('$Date: 2010-01-29 12:52:17 $',':')"> 5927 <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2010-01-29 12:52:17 $', 'Date: '),'$','')),', ')"/> 5864 5928 </xsl:if> 5865 5929 <xsl:value-of select="concat('XSLT vendor: ',system-property('xsl:vendor'),' ',system-property('xsl:vendor-url'))"/>
Note: See TracChangeset
for help on using the changeset viewer.