Changeset 1072 for rfc2629xslt/rfc2629.xslt
- Timestamp:
- 01/11/10 07:18:16 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
rfc2629xslt/rfc2629.xslt
r1019 r1072 1826 1826 </xsl:for-each> 1827 1827 <xsl:if test="@number"> 1828 <xsl:variable name="number">1829 <xsl:choose>1830 <xsl:when test="string-length(@number) < 2">000<xsl:value-of select="@number"/></xsl:when>1831 <xsl:when test="string-length(@number) < 3">00<xsl:value-of select="@number"/></xsl:when>1832 <xsl:when test="string-length(@number) < 4">0<xsl:value-of select="@number"/></xsl:when>1833 <xsl:otherwise><xsl:value-of select="@number"/></xsl:otherwise>1834 </xsl:choose>1835 </xsl:variable>1836 1828 <link rel="Alternate" title="Authorative ASCII Version" href="http://www.ietf.org/rfc/rfc{@number}.txt" /> 1837 <link rel="Help" title="Additional Information on tools.ietf.org" href="http://tools.ietf.org/html/rfc{$number}" /> 1829 <link rel="Help" title="RFC-Editor's Status Page" href="http://www.rfc-editor.org/info/rfc{@number}" /> 1830 <link rel="Help" title="Additional Information on tools.ietf.org" href="http://tools.ietf.org/html/rfc{@number}" /> 1838 1831 </xsl:if> 1839 1832 … … 2051 2044 </xsl:variable> 2052 2045 2053 <!-- process irefs immedia detely following the section so that their anchor2046 <!-- process irefs immediately following the section so that their anchor 2054 2047 actually is the section heading --> 2055 2048 <xsl:apply-templates select="iref[count(preceding-sibling::*[not(self::iref)])=0]"/> … … 2771 2764 <xsl:if test="$xml2rfc-ext-pub-day!='' and /rfc/@ipr and not(/rfc/@number)"> 2772 2765 <xsl:text> </xsl:text> 2773 <xsl:value-of select=" $xml2rfc-ext-pub-day" />2766 <xsl:value-of select="number($xml2rfc-ext-pub-day)" /> 2774 2767 <xsl:text>,</xsl:text> 2775 2768 </xsl:if> … … 3395 3388 display:table-header-group; 3396 3389 } 3397 ul.toc {3390 ul.toc, ul.toc ul { 3398 3391 list-style: none; 3399 3392 margin-left: 1.5em; … … 3401 3394 padding-left: 0em; 3402 3395 } 3403 li.tocline0{3396 ul.toc li { 3404 3397 line-height: 150%; 3405 3398 font-weight: bold; … … 3408 3401 margin-right: 0em; 3409 3402 } 3410 li.tocline1{3403 ul.toc li li { 3411 3404 line-height: normal; 3412 3405 font-weight: normal; … … 3415 3408 margin-right: 0em; 3416 3409 } 3417 li. tocline2{3410 li.excluded { 3418 3411 font-size: 0pt; 3419 3412 } … … 3428 3421 page-break-before: avoid; 3429 3422 } 3430 li.indline0{3423 ul.ind li { 3431 3424 font-weight: bold; 3432 3425 line-height: 200%; … … 3434 3427 margin-right: 0em; 3435 3428 } 3436 li.indline1{3429 ul.ind li li { 3437 3430 font-weight: normal; 3438 3431 line-height: 150%; … … 3592 3585 } 3593 3586 3594 a.iref {3587 ul.ind li li a {<!-- links in the leaf nodes of the index should go to page numbers --> 3595 3588 content: target-counter(attr(href), page); 3596 3589 } … … 3746 3739 </xsl:choose> 3747 3740 </xsl:variable> 3748 <a class="iref"href="{$backlink}">3741 <a href="{$backlink}"> 3749 3742 <xsl:call-template name="insertInsDelClass"/> 3750 3743 <xsl:choose> … … 3772 3765 <xsl:choose> 3773 3766 <xsl:when test="self::reference"> 3774 <a class="iref"href="#{@anchor}">3767 <a href="#{@anchor}"> 3775 3768 <xsl:call-template name="insertInsDelClass"/> 3776 3769 <b><xsl:value-of select="$n"/></b> … … 3780 3773 <xsl:variable name="target" select="@target"/> 3781 3774 <xsl:variable name="backlink">#<xsl:value-of select="$anchor-prefix"/>.xref.<xsl:value-of select="$target"/>.<xsl:number level="any" count="xref[@target=$target]"/></xsl:variable> 3782 <a class="iref"href="{$backlink}">3775 <a href="{$backlink}"> 3783 3776 <xsl:call-template name="insertInsDelClass"/> 3784 3777 <xsl:value-of select="$n"/> … … 3812 3805 <xsl:if test="translate($letter,concat($lcase,$ucase,'0123456789'),'')=''"> 3813 3806 3814 <xsl:variable name="showit"> 3815 <xsl:choose> 3816 <xsl:when test="$xml2rfc-ext-include-references-in-index!='yes'"> 3817 <xsl:if test="$irefs[starts-with(translate(@item,$lcase,$ucase),$letter)]"> 3818 <xsl:text>yes</xsl:text> 3819 </xsl:if> 3820 </xsl:when> 3821 <xsl:otherwise> 3822 <xsl:text>yes</xsl:text> 3823 </xsl:otherwise> 3824 </xsl:choose> 3825 </xsl:variable> 3807 <xsl:variable name="showit" select="$xml2rfc-ext-include-references-in-index='yes' or $irefs[starts-with(translate(@item,$lcase,$ucase),$letter)]"/> 3826 3808 3827 <xsl:if test="$showit ='yes'">3809 <xsl:if test="$showit"> 3828 3810 <a href="#{$anchor-prefix}.index.{$letter}"> 3829 3811 <xsl:value-of select="$letter" /> … … 3847 3829 <xsl:variable name="letter" select="translate(substring(concat(@item,@anchor),1,1),$lcase,$ucase)"/> 3848 3830 3849 <xsl:variable name="showit"> 3850 <xsl:choose> 3851 <xsl:when test="$xml2rfc-ext-include-references-in-index!='yes'"> 3852 <xsl:if test="$irefs2[starts-with(translate(@item,$lcase,$ucase),$letter)]"> 3853 <xsl:text>yes</xsl:text> 3854 </xsl:if> 3855 </xsl:when> 3856 <xsl:otherwise> 3857 <xsl:text>yes</xsl:text> 3858 </xsl:otherwise> 3859 </xsl:choose> 3860 </xsl:variable> 3861 3862 <xsl:if test="$showit='yes'"> 3863 <li class="indline0"> 3831 <xsl:variable name="showit" select="$xml2rfc-ext-include-references-in-index='yes' or $irefs2[starts-with(translate(@item,$lcase,$ucase),$letter)]"/> 3832 3833 <xsl:if test="$showit"> 3834 <li> 3864 3835 3865 3836 <!-- make letters and digits stand out --> … … 3875 3846 </xsl:choose> 3876 3847 3877 <ul class="ind">3848 <ul> 3878 3849 <xsl:for-each select="key('index-first-letter',translate(substring(concat(@item,@anchor),1,1),$lcase,$ucase))"> 3879 3850 … … 3883 3854 <xsl:when test="self::reference"> 3884 3855 <xsl:if test="$xml2rfc-ext-include-references-in-index='yes' and not(starts-with(@anchor,'deleted-'))"> 3885 <li class="indline1">3856 <li> 3886 3857 <em> 3887 3858 <xsl:value-of select="@anchor"/> … … 3898 3869 3899 3870 <xsl:if test="$rs2"> 3900 <ul class="ind">3871 <ul> 3901 3872 <xsl:for-each select="$rs2"> 3902 3873 <xsl:sort select="substring-before(concat(@x:sec,'.'),'.')" data-type="number"/> 3903 3874 <xsl:sort select="substring(@x:sec,2+string-length(substring-before(@x:sec,'.')))" data-type="number"/> 3904 3875 <xsl:if test="generate-id(.) = generate-id(key('index-xref-by-sec',concat(@target,'..',@x:sec)))"> 3905 <li class="indline1">3876 <li> 3906 3877 <em> 3907 3878 <xsl:choose> … … 3929 3900 <xsl:variable name="doc" select="document(current()/x:source/@href)"/> 3930 3901 <xsl:if test="$rs3"> 3931 <ul class="ind">3902 <ul> 3932 3903 <xsl:for-each select="$rs3"> 3933 3904 <xsl:sort select="count($doc//*[@anchor and following::*/@anchor=substring-after(current()/@x:rel,'#')])" order="ascending" data-type="number"/> 3934 3905 <xsl:if test="generate-id(.) = generate-id(key('index-xref-by-anchor',concat(@target,'..',@x:rel)))"> 3935 <li class="indline1">3906 <li> 3936 3907 <em> 3937 3908 <xsl:variable name="sec"> … … 3969 3940 <xsl:variable name="in-artwork" select="key('index-item',$item)[@primary='true' and ancestor::artwork]"/> 3970 3941 3971 <li class="indline1">3942 <li> 3972 3943 <xsl:choose> 3973 3944 <xsl:when test="$in-artwork"> … … 3991 3962 <xsl:variable name="s2" select="key('index-item',@item)[@subitem and @subitem!='']"/> 3992 3963 <xsl:if test="$s2"> 3993 <ul class="ind">3964 <ul> 3994 3965 <xsl:for-each select="$s2"> 3995 3966 <xsl:sort select="translate(@subitem,$lcase,$ucase)" /> … … 3999 3970 <xsl:variable name="in-artwork2" select="key('index-item-subitem',concat(@item,'..',@subitem))[@primary='true' and ancestor::artwork]" /> 4000 3971 4001 <li class="indline1">3972 <li> 4002 3973 4003 3974 <xsl:choose> … … 4540 4511 <xsl:when test="($tocparam='' or $tocparam='default') and string-length(translate($number,'.ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890§','.')) >= $parsedTocDepth"> 4541 4512 <!-- dropped entry because excluded --> 4542 <xsl:attribute name="class"> tocline2</xsl:attribute>4513 <xsl:attribute name="class">excluded</xsl:attribute> 4543 4514 </xsl:when> 4544 4515 <xsl:when test="$tocparam='exclude'"> 4545 4516 <!-- dropped entry because excluded --> 4546 <xsl:attribute name="class"> tocline2</xsl:attribute>4517 <xsl:attribute name="class">excluded</xsl:attribute> 4547 4518 </xsl:when> 4548 4519 <xsl:otherwise> … … 4555 4526 </xsl:when> 4556 4527 <xsl:otherwise> 4557 <xsl:choose>4558 <xsl:when test="not(contains($number,'.'))">4559 <xsl:attribute name="class">tocline0</xsl:attribute>4560 </xsl:when>4561 <xsl:otherwise>4562 <xsl:attribute name="class">tocline1</xsl:attribute>4563 </xsl:otherwise>4564 </xsl:choose>4565 4528 <xsl:if test="$number != '' and not(contains($number,'unnumbered-'))"> 4566 4529 <xsl:call-template name="emit-section-number"> … … 4692 4655 </xsl:call-template> 4693 4656 4694 <ul class="toc">4657 <ul> 4695 4658 <!-- ...with subsections... --> 4696 4659 <xsl:for-each select="$refsecs"> … … 4748 4711 </xsl:call-template> 4749 4712 4750 <ul class="toc">4713 <ul> 4751 4714 <xsl:apply-templates mode="toc" /> 4752 4715 </ul> … … 4767 4730 <!-- obtain nested content, just to check whether we need to recurse at all --> 4768 4731 <xsl:variable name="nested-content"> 4769 <ul class="toc">4732 <ul> 4770 4733 <xsl:apply-templates mode="toc" /> 4771 4734 </ul> … … 4774 4737 <!-- only recurse if we need to (do not produce useless list container) --> 4775 4738 <xsl:if test="$nested-content!=''"> 4776 <ul class="toc">4739 <ul> 4777 4740 <xsl:apply-templates mode="toc" /> 4778 4741 </ul> … … 4802 4765 4803 4766 <xsl:if test="//figure[@title!='' or @anchor!='']"> 4804 <ul class="toc">4767 <ul> 4805 4768 <xsl:for-each select="//figure[@title!='' or @anchor!='']"> 4806 4769 <xsl:variable name="title">Figure <xsl:value-of select="position()"/><xsl:if test="@title">: <xsl:value-of select="@title"/></xsl:if> … … 6204 6167 <xsl:text>http://greenbytes.de/tech/webdav/rfc2629.xslt, </xsl:text> 6205 6168 <!-- when RCS keyword substitution in place, add version info --> 6206 <xsl:if test="contains('$Revision: 1.5 24$',':')">6207 <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.5 24$', 'Revision: '),'$','')),', ')" />6169 <xsl:if test="contains('$Revision: 1.531 $',':')"> 6170 <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.531 $', 'Revision: '),'$','')),', ')" /> 6208 6171 </xsl:if> 6209 <xsl:if test="contains('$Date: 2010- 09-14 12:37:11$',':')">6210 <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2010- 09-14 12:37:11$', 'Date: '),'$','')),', ')" />6172 <xsl:if test="contains('$Date: 2010-10-31 21:50:52 $',':')"> 6173 <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2010-10-31 21:50:52 $', 'Date: '),'$','')),', ')" /> 6211 6174 </xsl:if> 6212 6175 <xsl:value-of select="concat('XSLT vendor: ',system-property('xsl:vendor'),' ',system-property('xsl:vendor-url'))" /> … … 6729 6692 6730 6693 <msxsl:script language="JScript" implements-prefix="date"> 6731 this['year'] = function (x) { 6732 if (x) {throw "not supported"}; 6733 return (new Date()).getFullYear(); 6694 function twodigits(s) { 6695 return s < 10 ? "0" + s : s; 6734 6696 } 6735 6697 6736 this['month-in-year'] = function (x) { 6737 if (x) {throw "not supported"}; 6738 return 1 + (new Date()).getMonth(); 6739 } 6740 6741 this['day-in-month'] = function (x) { 6742 if (x) {throw "not supported"}; 6743 return (new Date()).getDate(); 6698 this['date-time'] = function (x) { 6699 var now = new Date(); 6700 var offs = now.getTimezoneOffset(); 6701 return now.getFullYear() + "-" 6702 + twodigits(1 + now.getMonth()) + "-" 6703 + twodigits(now.getDate()) + "T" 6704 + twodigits(now.getHours()) + ":" 6705 + twodigits(now.getMinutes()) + ":" 6706 + twodigits(now.getSeconds()) 6707 + (offs >= 0 ? "-" : "+") 6708 + twodigits(Math.abs(offs) / 60) + ":" 6709 + twodigits(Math.abs(offs) % 60); 6744 6710 } 6745 6711 </msxsl:script> 6746 6712 6713 <xsl:variable name="current-year"> 6714 <xsl:choose> 6715 <xsl:when test="function-available('date:date-time')"> 6716 <xsl:value-of select="substring-before(date:date-time(),'-')"/> 6717 </xsl:when> 6718 <xsl:otherwise/> 6719 </xsl:choose> 6720 </xsl:variable> 6721 6722 <xsl:variable name="current-month"> 6723 <xsl:choose> 6724 <xsl:when test="function-available('date:date-time')"> 6725 <xsl:value-of select="substring-before(substring-after(date:date-time(),'-'),'-')"/> 6726 </xsl:when> 6727 <xsl:otherwise/> 6728 </xsl:choose> 6729 </xsl:variable> 6730 6731 <xsl:variable name="current-day"> 6732 <xsl:choose> 6733 <xsl:when test="function-available('date:date-time')"> 6734 <xsl:value-of select="substring-after(substring-after(substring-before(date:date-time(),'T'),'-'),'-')"/> 6735 </xsl:when> 6736 <xsl:otherwise/> 6737 </xsl:choose> 6738 </xsl:variable> 6739 6747 6740 <xsl:variable name="may-default-dates"> 6748 6741 <xsl:choose> 6749 <xsl:when test=" function-available('date:year') and function-available('date:month-in-year') and function-available('date:day-in-month')">6742 <xsl:when test="$current-year!='' and $current-month!='' and $current-day!=''"> 6750 6743 <xsl:variable name="year-specified" select="/rfc/front/date/@year and /rfc/front/date/@year!=''"/> 6751 6744 <xsl:variable name="month-specified" select="/rfc/front/date/@month and /rfc/front/date/@month!=''"/> … … 6753 6746 <xsl:variable name="system-month"> 6754 6747 <xsl:call-template name="get-month-as-name"> 6755 <xsl:with-param name="month" select=" date:month-in-year()"/>6748 <xsl:with-param name="month" select="$current-month"/> 6756 6749 </xsl:call-template> 6757 6750 </xsl:variable> 6758 6751 <xsl:choose> 6759 <xsl:when test="$year-specified and /rfc/front/date/@year!= date:year()">Specified year <xsl:value-of select="/rfc/front/date/@year"/> does not match system date (<xsl:value-of select="date:year()"/>)</xsl:when>6752 <xsl:when test="$year-specified and /rfc/front/date/@year!=$current-year">Specified year <xsl:value-of select="/rfc/front/date/@year"/> does not match system date (<xsl:value-of select="$current-year"/>)</xsl:when> 6760 6753 <xsl:when test="$month-specified and /rfc/front/date/@month!=$system-month">Specified month <xsl:value-of select="/rfc/front/date/@month"/> does not match system date (<xsl:value-of select="$system-month"/>)</xsl:when> 6761 <xsl:when test="$day-specified and /rfc/front/date/@day!= date:day-in-month()">Specified day does not match system date</xsl:when>6754 <xsl:when test="$day-specified and /rfc/front/date/@day!=$current-day">Specified day does not match system date</xsl:when> 6762 6755 <xsl:when test="not($year-specified) and ($month-specified or $day-specified)">Can't default year when month or day is specified</xsl:when> 6763 6756 <xsl:when test="not($month-specified) and $day-specified">Can't default month when day is specified</xsl:when> … … 6775 6768 <xsl:value-of select="/rfc/front/date/@year"/> 6776 6769 </xsl:when> 6777 <xsl:when test=" function-available('date:year')and $may-default-dates='yes'">6778 <xsl:value-of select=" date:year()"/>6779 </xsl:when> 6780 <xsl:when test=" function-available('date:year')and $may-default-dates!='yes'">6770 <xsl:when test="$current-year!='' and $may-default-dates='yes'"> 6771 <xsl:value-of select="$current-year"/> 6772 </xsl:when> 6773 <xsl:when test="$current-year!='' and $may-default-dates!='yes'"> 6781 6774 <xsl:call-template name="warning"> 6782 6775 <xsl:with-param name="inline" select="'no'"/> … … 6797 6790 <xsl:value-of select="/rfc/front/date/@month"/> 6798 6791 </xsl:when> 6799 <xsl:when test=" function-available('date:month-in-year')and $may-default-dates='yes'">6792 <xsl:when test="$current-month!='' and $may-default-dates='yes'"> 6800 6793 <xsl:call-template name="get-month-as-name"> 6801 <xsl:with-param name="month" select=" date:month-in-year()"/>6794 <xsl:with-param name="month" select="$current-month"/> 6802 6795 </xsl:call-template> 6803 6796 </xsl:when> 6804 <xsl:when test=" function-available('date:month-in-year')and $may-default-dates!='yes'">6797 <xsl:when test="$current-month!='' and $may-default-dates!='yes'"> 6805 6798 <xsl:call-template name="warning"> 6806 6799 <xsl:with-param name="inline" select="'no'"/> … … 6827 6820 <xsl:value-of select="/rfc/front/date/@day"/> 6828 6821 </xsl:when> 6829 <xsl:when test=" function-available('date:day-in-month')and $may-default-dates='yes'">6830 <xsl:value-of select=" date:day-in-month()"/>6822 <xsl:when test="$current-day!='' and $may-default-dates='yes'"> 6823 <xsl:value-of select="$current-day"/> 6831 6824 </xsl:when> 6832 6825 <xsl:otherwise /> <!-- harmless, we just don't have it -->
Note: See TracChangeset
for help on using the changeset viewer.