Changeset 1072 for rfc2629xslt/rfc2629toXHTML.xslt
- Timestamp:
- 01/11/10 07:18:16 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
rfc2629xslt/rfc2629toXHTML.xslt
r1019 r1072 1694 1694 </xsl:for-each> 1695 1695 <xsl:if test="@number"> 1696 <xsl:variable name="number">1697 <xsl:choose>1698 <xsl:when test="string-length(@number) < 2">000<xsl:value-of select="@number"/></xsl:when>1699 <xsl:when test="string-length(@number) < 3">00<xsl:value-of select="@number"/></xsl:when>1700 <xsl:when test="string-length(@number) < 4">0<xsl:value-of select="@number"/></xsl:when>1701 <xsl:otherwise><xsl:value-of select="@number"/></xsl:otherwise>1702 </xsl:choose>1703 </xsl:variable>1704 1696 <link rel="Alternate" title="Authorative ASCII Version" href="http://www.ietf.org/rfc/rfc{@number}.txt"/> 1705 <link rel="Help" title="Additional Information on tools.ietf.org" href="http://tools.ietf.org/html/rfc{$number}"/> 1697 <link rel="Help" title="RFC-Editor's Status Page" href="http://www.rfc-editor.org/info/rfc{@number}"/> 1698 <link rel="Help" title="Additional Information on tools.ietf.org" href="http://tools.ietf.org/html/rfc{@number}"/> 1706 1699 </xsl:if> 1707 1700 … … 1919 1912 </xsl:variable> 1920 1913 1921 <!-- process irefs immedia detely following the section so that their anchor1914 <!-- process irefs immediately following the section so that their anchor 1922 1915 actually is the section heading --> 1923 1916 <xsl:apply-templates select="iref[count(preceding-sibling::*[not(self::iref)])=0]"/> … … 2639 2632 <xsl:if test="$xml2rfc-ext-pub-day!='' and /rfc/@ipr and not(/rfc/@number)"> 2640 2633 <xsl:text> </xsl:text> 2641 <xsl:value-of select=" $xml2rfc-ext-pub-day"/>2634 <xsl:value-of select="number($xml2rfc-ext-pub-day)"/> 2642 2635 <xsl:text>,</xsl:text> 2643 2636 </xsl:if> … … 3263 3256 display:table-header-group; 3264 3257 } 3265 ul.toc {3258 ul.toc, ul.toc ul { 3266 3259 list-style: none; 3267 3260 margin-left: 1.5em; … … 3269 3262 padding-left: 0em; 3270 3263 } 3271 li.tocline0{3264 ul.toc li { 3272 3265 line-height: 150%; 3273 3266 font-weight: bold; … … 3276 3269 margin-right: 0em; 3277 3270 } 3278 li.tocline1{3271 ul.toc li li { 3279 3272 line-height: normal; 3280 3273 font-weight: normal; … … 3283 3276 margin-right: 0em; 3284 3277 } 3285 li. tocline2{3278 li.excluded { 3286 3279 font-size: 0pt; 3287 3280 } … … 3296 3289 page-break-before: avoid; 3297 3290 } 3298 li.indline0{3291 ul.ind li { 3299 3292 font-weight: bold; 3300 3293 line-height: 200%; … … 3302 3295 margin-right: 0em; 3303 3296 } 3304 li.indline1{3297 ul.ind li li { 3305 3298 font-weight: normal; 3306 3299 line-height: 150%; … … 3460 3453 } 3461 3454 3462 a.iref {3455 ul.ind li li a {<!-- links in the leaf nodes of the index should go to page numbers --> 3463 3456 content: target-counter(attr(href), page); 3464 3457 } … … 3614 3607 </xsl:choose> 3615 3608 </xsl:variable> 3616 <a xmlns="http://www.w3.org/1999/xhtml" class="iref"href="{$backlink}">3609 <a xmlns="http://www.w3.org/1999/xhtml" href="{$backlink}"> 3617 3610 <xsl:call-template name="insertInsDelClass"/> 3618 3611 <xsl:choose> … … 3640 3633 <xsl:choose> 3641 3634 <xsl:when test="self::reference"> 3642 <a xmlns="http://www.w3.org/1999/xhtml" class="iref"href="#{@anchor}">3635 <a xmlns="http://www.w3.org/1999/xhtml" href="#{@anchor}"> 3643 3636 <xsl:call-template name="insertInsDelClass"/> 3644 3637 <b><xsl:value-of select="$n"/></b> … … 3648 3641 <xsl:variable name="target" select="@target"/> 3649 3642 <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> 3650 <a xmlns="http://www.w3.org/1999/xhtml" class="iref"href="{$backlink}">3643 <a xmlns="http://www.w3.org/1999/xhtml" href="{$backlink}"> 3651 3644 <xsl:call-template name="insertInsDelClass"/> 3652 3645 <xsl:value-of select="$n"/> … … 3680 3673 <xsl:if test="translate($letter,concat($lcase,$ucase,'0123456789'),'')=''"> 3681 3674 3682 <xsl:variable name="showit"> 3683 <xsl:choose> 3684 <xsl:when test="$xml2rfc-ext-include-references-in-index!='yes'"> 3685 <xsl:if test="$irefs[starts-with(translate(@item,$lcase,$ucase),$letter)]"> 3686 <xsl:text>yes</xsl:text> 3687 </xsl:if> 3688 </xsl:when> 3689 <xsl:otherwise> 3690 <xsl:text>yes</xsl:text> 3691 </xsl:otherwise> 3692 </xsl:choose> 3693 </xsl:variable> 3675 <xsl:variable name="showit" select="$xml2rfc-ext-include-references-in-index='yes' or $irefs[starts-with(translate(@item,$lcase,$ucase),$letter)]"/> 3694 3676 3695 <xsl:if test="$showit ='yes'">3677 <xsl:if test="$showit"> 3696 3678 <a href="#{$anchor-prefix}.index.{$letter}"> 3697 3679 <xsl:value-of select="$letter"/> … … 3715 3697 <xsl:variable name="letter" select="translate(substring(concat(@item,@anchor),1,1),$lcase,$ucase)"/> 3716 3698 3717 <xsl:variable name="showit"> 3718 <xsl:choose> 3719 <xsl:when test="$xml2rfc-ext-include-references-in-index!='yes'"> 3720 <xsl:if test="$irefs2[starts-with(translate(@item,$lcase,$ucase),$letter)]"> 3721 <xsl:text>yes</xsl:text> 3722 </xsl:if> 3723 </xsl:when> 3724 <xsl:otherwise> 3725 <xsl:text>yes</xsl:text> 3726 </xsl:otherwise> 3727 </xsl:choose> 3728 </xsl:variable> 3729 3730 <xsl:if test="$showit='yes'"> 3731 <li class="indline0"> 3699 <xsl:variable name="showit" select="$xml2rfc-ext-include-references-in-index='yes' or $irefs2[starts-with(translate(@item,$lcase,$ucase),$letter)]"/> 3700 3701 <xsl:if test="$showit"> 3702 <li> 3732 3703 3733 3704 <!-- make letters and digits stand out --> … … 3743 3714 </xsl:choose> 3744 3715 3745 <ul class="ind">3716 <ul> 3746 3717 <xsl:for-each select="key('index-first-letter',translate(substring(concat(@item,@anchor),1,1),$lcase,$ucase))"> 3747 3718 … … 3751 3722 <xsl:when test="self::reference"> 3752 3723 <xsl:if test="$xml2rfc-ext-include-references-in-index='yes' and not(starts-with(@anchor,'deleted-'))"> 3753 <li class="indline1">3724 <li> 3754 3725 <em> 3755 3726 <xsl:value-of select="@anchor"/> … … 3766 3737 3767 3738 <xsl:if test="$rs2"> 3768 <ul class="ind">3739 <ul> 3769 3740 <xsl:for-each select="$rs2"> 3770 3741 <xsl:sort select="substring-before(concat(@x:sec,'.'),'.')" data-type="number"/> 3771 3742 <xsl:sort select="substring(@x:sec,2+string-length(substring-before(@x:sec,'.')))" data-type="number"/> 3772 3743 <xsl:if test="generate-id(.) = generate-id(key('index-xref-by-sec',concat(@target,'..',@x:sec)))"> 3773 <li class="indline1">3744 <li> 3774 3745 <em> 3775 3746 <xsl:choose> … … 3797 3768 <xsl:variable name="doc" select="document(current()/x:source/@href)"/> 3798 3769 <xsl:if test="$rs3"> 3799 <ul class="ind">3770 <ul> 3800 3771 <xsl:for-each select="$rs3"> 3801 3772 <xsl:sort select="count($doc//*[@anchor and following::*/@anchor=substring-after(current()/@x:rel,'#')])" order="ascending" data-type="number"/> 3802 3773 <xsl:if test="generate-id(.) = generate-id(key('index-xref-by-anchor',concat(@target,'..',@x:rel)))"> 3803 <li class="indline1">3774 <li> 3804 3775 <em> 3805 3776 <xsl:variable name="sec"> … … 3837 3808 <xsl:variable name="in-artwork" select="key('index-item',$item)[@primary='true' and ancestor::artwork]"/> 3838 3809 3839 <li class="indline1">3810 <li> 3840 3811 <xsl:choose> 3841 3812 <xsl:when test="$in-artwork"> … … 3859 3830 <xsl:variable name="s2" select="key('index-item',@item)[@subitem and @subitem!='']"/> 3860 3831 <xsl:if test="$s2"> 3861 <ul class="ind">3832 <ul> 3862 3833 <xsl:for-each select="$s2"> 3863 3834 <xsl:sort select="translate(@subitem,$lcase,$ucase)"/> … … 3867 3838 <xsl:variable name="in-artwork2" select="key('index-item-subitem',concat(@item,'..',@subitem))[@primary='true' and ancestor::artwork]"/> 3868 3839 3869 <li class="indline1">3840 <li> 3870 3841 3871 3842 <xsl:choose> … … 4399 4370 <xsl:when test="($tocparam='' or $tocparam='default') and string-length(translate($number,'.ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890§','.')) >= $parsedTocDepth"> 4400 4371 <!-- dropped entry because excluded --> 4401 <xsl:attribute name="class"> tocline2</xsl:attribute>4372 <xsl:attribute name="class">excluded</xsl:attribute> 4402 4373 </xsl:when> 4403 4374 <xsl:when test="$tocparam='exclude'"> 4404 4375 <!-- dropped entry because excluded --> 4405 <xsl:attribute name="class"> tocline2</xsl:attribute>4376 <xsl:attribute name="class">excluded</xsl:attribute> 4406 4377 </xsl:when> 4407 4378 <xsl:otherwise> … … 4414 4385 </xsl:when> 4415 4386 <xsl:otherwise> 4416 <xsl:choose>4417 <xsl:when test="not(contains($number,'.'))">4418 <xsl:attribute name="class">tocline0</xsl:attribute>4419 </xsl:when>4420 <xsl:otherwise>4421 <xsl:attribute name="class">tocline1</xsl:attribute>4422 </xsl:otherwise>4423 </xsl:choose>4424 4387 <xsl:if test="$number != '' and not(contains($number,'unnumbered-'))"> 4425 4388 <xsl:call-template name="emit-section-number"> … … 4551 4514 </xsl:call-template> 4552 4515 4553 <ul class="toc">4516 <ul> 4554 4517 <!-- ...with subsections... --> 4555 4518 <xsl:for-each select="$refsecs"> … … 4607 4570 </xsl:call-template> 4608 4571 4609 <ul class="toc">4572 <ul> 4610 4573 <xsl:apply-templates mode="toc"/> 4611 4574 </ul> … … 4626 4589 <!-- obtain nested content, just to check whether we need to recurse at all --> 4627 4590 <xsl:variable name="nested-content"> 4628 <ul class="toc">4591 <ul> 4629 4592 <xsl:apply-templates mode="toc"/> 4630 4593 </ul> … … 4633 4596 <!-- only recurse if we need to (do not produce useless list container) --> 4634 4597 <xsl:if test="$nested-content!=''"> 4635 <ul class="toc">4598 <ul> 4636 4599 <xsl:apply-templates mode="toc"/> 4637 4600 </ul> … … 4661 4624 4662 4625 <xsl:if test="//figure[@title!='' or @anchor!='']"> 4663 <ul xmlns="http://www.w3.org/1999/xhtml" class="toc">4626 <ul xmlns="http://www.w3.org/1999/xhtml"> 4664 4627 <xsl:for-each select="//figure[@title!='' or @anchor!='']"> 4665 4628 <xsl:variable name="title">Figure <xsl:value-of select="position()"/><xsl:if test="@title">: <xsl:value-of select="@title"/></xsl:if> … … 6062 6025 <xsl:text>http://greenbytes.de/tech/webdav/rfc2629.xslt, </xsl:text> 6063 6026 <!-- when RCS keyword substitution in place, add version info --> 6064 <xsl:if test="contains('$Revision: 1.5 24$',':')">6065 <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.5 24$', 'Revision: '),'$','')),', ')"/>6027 <xsl:if test="contains('$Revision: 1.531 $',':')"> 6028 <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.531 $', 'Revision: '),'$','')),', ')"/> 6066 6029 </xsl:if> 6067 <xsl:if test="contains('$Date: 2010- 09-14 12:37:11$',':')">6068 <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2010- 09-14 12:37:11$', 'Date: '),'$','')),', ')"/>6030 <xsl:if test="contains('$Date: 2010-10-31 21:50:52 $',':')"> 6031 <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2010-10-31 21:50:52 $', 'Date: '),'$','')),', ')"/> 6069 6032 </xsl:if> 6070 6033 <xsl:value-of select="concat('XSLT vendor: ',system-property('xsl:vendor'),' ',system-property('xsl:vendor-url'))"/> … … 6587 6550 6588 6551 <msxsl:script language="JScript" implements-prefix="date"> 6589 this['year'] = function (x) { 6590 if (x) {throw "not supported"}; 6591 return (new Date()).getFullYear(); 6552 function twodigits(s) { 6553 return s < 10 ? "0" + s : s; 6592 6554 } 6593 6555 6594 this['month-in-year'] = function (x) { 6595 if (x) {throw "not supported"}; 6596 return 1 + (new Date()).getMonth(); 6597 } 6598 6599 this['day-in-month'] = function (x) { 6600 if (x) {throw "not supported"}; 6601 return (new Date()).getDate(); 6556 this['date-time'] = function (x) { 6557 var now = new Date(); 6558 var offs = now.getTimezoneOffset(); 6559 return now.getFullYear() + "-" 6560 + twodigits(1 + now.getMonth()) + "-" 6561 + twodigits(now.getDate()) + "T" 6562 + twodigits(now.getHours()) + ":" 6563 + twodigits(now.getMinutes()) + ":" 6564 + twodigits(now.getSeconds()) 6565 + (offs >= 0 ? "-" : "+") 6566 + twodigits(Math.abs(offs) / 60) + ":" 6567 + twodigits(Math.abs(offs) % 60); 6602 6568 } 6603 6569 </msxsl:script> 6604 6570 6571 <xsl:variable name="current-year"> 6572 <xsl:choose> 6573 <xsl:when test="function-available('date:date-time')"> 6574 <xsl:value-of select="substring-before(date:date-time(),'-')"/> 6575 </xsl:when> 6576 <xsl:otherwise/> 6577 </xsl:choose> 6578 </xsl:variable> 6579 6580 <xsl:variable name="current-month"> 6581 <xsl:choose> 6582 <xsl:when test="function-available('date:date-time')"> 6583 <xsl:value-of select="substring-before(substring-after(date:date-time(),'-'),'-')"/> 6584 </xsl:when> 6585 <xsl:otherwise/> 6586 </xsl:choose> 6587 </xsl:variable> 6588 6589 <xsl:variable name="current-day"> 6590 <xsl:choose> 6591 <xsl:when test="function-available('date:date-time')"> 6592 <xsl:value-of select="substring-after(substring-after(substring-before(date:date-time(),'T'),'-'),'-')"/> 6593 </xsl:when> 6594 <xsl:otherwise/> 6595 </xsl:choose> 6596 </xsl:variable> 6597 6605 6598 <xsl:variable name="may-default-dates"> 6606 6599 <xsl:choose> 6607 <xsl:when test=" function-available('date:year') and function-available('date:month-in-year') and function-available('date:day-in-month')">6600 <xsl:when test="$current-year!='' and $current-month!='' and $current-day!=''"> 6608 6601 <xsl:variable name="year-specified" select="/rfc/front/date/@year and /rfc/front/date/@year!=''"/> 6609 6602 <xsl:variable name="month-specified" select="/rfc/front/date/@month and /rfc/front/date/@month!=''"/> … … 6611 6604 <xsl:variable name="system-month"> 6612 6605 <xsl:call-template name="get-month-as-name"> 6613 <xsl:with-param name="month" select=" date:month-in-year()"/>6606 <xsl:with-param name="month" select="$current-month"/> 6614 6607 </xsl:call-template> 6615 6608 </xsl:variable> 6616 6609 <xsl:choose> 6617 <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>6610 <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> 6618 6611 <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> 6619 <xsl:when test="$day-specified and /rfc/front/date/@day!= date:day-in-month()">Specified day does not match system date</xsl:when>6612 <xsl:when test="$day-specified and /rfc/front/date/@day!=$current-day">Specified day does not match system date</xsl:when> 6620 6613 <xsl:when test="not($year-specified) and ($month-specified or $day-specified)">Can't default year when month or day is specified</xsl:when> 6621 6614 <xsl:when test="not($month-specified) and $day-specified">Can't default month when day is specified</xsl:when> … … 6633 6626 <xsl:value-of select="/rfc/front/date/@year"/> 6634 6627 </xsl:when> 6635 <xsl:when test=" function-available('date:year')and $may-default-dates='yes'">6636 <xsl:value-of select=" date:year()"/>6637 </xsl:when> 6638 <xsl:when test=" function-available('date:year')and $may-default-dates!='yes'">6628 <xsl:when test="$current-year!='' and $may-default-dates='yes'"> 6629 <xsl:value-of select="$current-year"/> 6630 </xsl:when> 6631 <xsl:when test="$current-year!='' and $may-default-dates!='yes'"> 6639 6632 <xsl:call-template name="warning"> 6640 6633 <xsl:with-param name="inline" select="'no'"/> … … 6655 6648 <xsl:value-of select="/rfc/front/date/@month"/> 6656 6649 </xsl:when> 6657 <xsl:when test=" function-available('date:month-in-year')and $may-default-dates='yes'">6650 <xsl:when test="$current-month!='' and $may-default-dates='yes'"> 6658 6651 <xsl:call-template name="get-month-as-name"> 6659 <xsl:with-param name="month" select=" date:month-in-year()"/>6652 <xsl:with-param name="month" select="$current-month"/> 6660 6653 </xsl:call-template> 6661 6654 </xsl:when> 6662 <xsl:when test=" function-available('date:month-in-year')and $may-default-dates!='yes'">6655 <xsl:when test="$current-month!='' and $may-default-dates!='yes'"> 6663 6656 <xsl:call-template name="warning"> 6664 6657 <xsl:with-param name="inline" select="'no'"/> … … 6685 6678 <xsl:value-of select="/rfc/front/date/@day"/> 6686 6679 </xsl:when> 6687 <xsl:when test=" function-available('date:day-in-month')and $may-default-dates='yes'">6688 <xsl:value-of select=" date:day-in-month()"/>6680 <xsl:when test="$current-day!='' and $may-default-dates='yes'"> 6681 <xsl:value-of select="$current-day"/> 6689 6682 </xsl:when> 6690 6683 <xsl:otherwise/> <!-- harmless, we just don't have it -->
Note: See TracChangeset
for help on using the changeset viewer.