Changeset 701


Ignore:
Timestamp:
Sep 27, 2009, 3:20:04 AM (10 years ago)
Author:
julian.reschke@…
Message:

xml2rfc.tcl v1.34pre4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • xml2rfc/xml2rfc.tcl

    r455 r701  
    1212global prog prog_version prog_url prog_ack
    1313set prog "xml2rfc"
    14 set prog_version "v1.34pre3"
     14set prog_version "v1.34pre4"
    1515set prog_url "http://xml.resource.org/"
    1616set prog_ack \
     
    43324332                    if {[lsearch0 $iprstatus $attrs(ipr)] < 0} {
    43334333                        unexpected error \
    4334                             "ipr=\"$attrs(ipr)\" attribute unknown in #$elemN:<rfc>" 
     4334                            "ipr=\"$attrs(ipr)\" attribute unknown in #$elemN:<rfc>"
    43354335                   }
    43364336                    if {   [regexp -- {[0-9]$} $attrs(ipr)]
     
    54975497    global counter elem passno xref
    54985498    global options copyrightP iprP
    5499     global copyshort copyshort1 copyshort2 copyshort3 copyshort4 copyshort5
     5499    global copyshort copyshort1 copyshort2 copyshort3 copyshort4 copyshort5 \
     5500           copyshort6 copyshort7
    55005501    global funding funding1 funding2
    55015502    global backP
     
    55255526    }
    55265527
    5527     # XXX why is newP set two different places
    55285528    set newP 7
    5529     if {[string compare $attrs(number) ""]} {
     5529    if {[catch { clock format $fv(.PARSEDDATE) -format "%Y%m%d" -gmt true } \
     5530               ymd]} {
     5531        # Should differentiate between PARSEDATE not set (e.g., early pass)
     5532        # vs. PARSEDATE set to 0 (i.e., couldn't parse date)
     5533        set ymd ""
     5534    }
     5535
     5536    if {$ymd >= "20091201"} {
     5537        if {![string compare $attrs(ipr) "pre5378Trust200902"]} {
     5538            set newP 9
     5539        } else {
     5540            set newP 6
     5541        }
     5542    } elseif {[string compare $attrs(number) ""]} {
    55305543        if {$attrs(number) <= 2499} {
    55315544            set newP 0
     
    55415554            set newP 4
    55425555        }
    5543         # TODO: set newP using PARSEDDATE for all the options
    5544         if {[catch {set ymd [clock format $fv(.PARSEDDATE) -format "%Y%m%d" -gmt true]}]} {
    5545             # Should differentiate between PARSEDATE not set (e.g., early pass)
    5546             # vs. PARSEDATE set to 0 (i.e., couldn't parse date)
    5547             set ymd ""
    5548         }
    55495556        if {$ymd < "20081101"} {
    55505557            set newP 5
     5558        } elseif {![string compare $attrs(ipr) "pre5378Trust200902"]} {
     5559            set newP 8
    55515560        }
    55525561    } elseif {[string compare $attrs(ipr) ""]} {
    55535562        if {   [string first "3667" $attrs(ipr)] >= 0
    55545563            || [string first "3978" $attrs(ipr)] >= 0} {
    5555             set newP 5
    5556         } elseif {[string first "trust" [string tolower $attrs(ipr)]] < 0} {
     5564            set newP 5
     5565        } elseif {[string first "trust" [string tolower $attrs(ipr)]] < 0} {
    55575566            set newP 1
    55585567        }
    55595568    }
    5560     if {$newP == 7} {
     5569
     5570    if {$newP == 9} {
     5571        set copyshort $copyshort7
     5572        set funding ""
     5573        set copyrightP -1
     5574        set iprP 0
     5575    } elseif {$newP == 8} {
     5576        set copyshort $copyshort6
     5577        set funding ""
     5578        set copyrightP -1
     5579        set iprP 0
     5580    } elseif {$newP == 7} {
    55615581        set copyshort $copyshort5
    55625582        set funding ""
     
    56895709    set front [find_element front $attrs(.CHILDREN)]
    56905710    array set fv $elem($front)
    5691     if {[catch {set ymd [clock format $fv(.PARSEDDATE) -format "%Y%m%d" -gmt true]}]} {
    5692         set ymd ""
    5693 #!# puts "no PARSEDDATE"
     5711    if {[catch { clock format $fv(.PARSEDDATE) -format "%Y%m%d" -gmt true } \
     5712               ymd]} {
     5713        # Should differentiate between PARSEDATE not set (e.g., early pass)
     5714        # vs. PARSEDATE set to 0 (i.e., couldn't parse date)
     5715        set ymd ""
    56945716    }
    56955717
     
    59956017publication of this document.  Please review these documents
    59966018carefully, as they describe your rights and restrictions with respect
    5997 to this document."}
     6019to this document. Code Components extracted from this document must
     6020include Simplified BSD License text as described in Section 4.e of
     6021the Trust Legal Provisions and are provided without warranty as
     6022described in the BSD License."}
    59986023
    59996024# Trust, try 2.
     
    60076032Please review these documents carefully, as they describe your
    60086033rights and restrictions with respect to this document."}
     6034
     6035# Trust, try 3.
     6036set copyshort6 \
     6037{"Copyright (c) %YEAR% IETF Trust and the persons identified as the
     6038document authors.  All rights reserved."
     6039
     6040"This document is subject to BCP 78 and the IETF Trust's Legal
     6041Provisions Relating to IETF Documents in effect on the date of
     6042publication of this document (http://trustee.ietf.org/license-info).
     6043Please review these documents carefully, as they describe your
     6044rights and restrictions with respect to this document."
     6045
     6046"This document may contain material from IETF Documents or IETF
     6047Contributions published or made publicly available before November
     604810, 2008.  The person(s) controlling the copyright in some of this
     6049material may not have granted the IETF Trust the right to allow
     6050modifications of such material outside the IETF Standards Process.
     6051Without obtaining an adequate license from the person(s) controlling
     6052the copyright in such materials, this document may not be modified
     6053outside the IETF Standards Process, and derivative works of it may
     6054not be created outside the IETF Standards Process, except to format
     6055it for publication as an RFC or to translate it into languages other
     6056than English."}
     6057
     6058set copyshort7 \
     6059{"Copyright (c) %YEAR% IETF Trust and the persons identified as the
     6060document authors.  All rights reserved."
     6061
     6062"This document is subject to BCP 78 and the IETF Trust's Legal
     6063Provisions Relating to IETF Documents
     6064(http://trustee.ietf.org/license-info) in effect on the date of
     6065publication of this document.  Please review these documents
     6066carefully, as they describe your rights and restrictions with respect
     6067to this document. Code Components extracted from this document must
     6068include Simplified BSD License text as described in Section 4.e of
     6069the Trust Legal Provisions and are provided without warranty as
     6070described in the BSD License."
     6071
     6072"This document may contain material from IETF Documents or IETF
     6073Contributions published or made publicly available before November
     607410, 2008.  The person(s) controlling the copyright in some of this
     6075material may not have granted the IETF Trust the right to allow
     6076modifications of such material outside the IETF Standards Process.
     6077Without obtaining an adequate license from the person(s) controlling
     6078the copyright in such materials, this document may not be modified
     6079outside the IETF Standards Process, and derivative works of it may
     6080not be created outside the IETF Standards Process, except to format
     6081it for publication as an RFC or to translate it into languages other
     6082than English."}
    60096083
    60106084# From the ietf/1id-guidelines.txt file, Section 5.
     
    61906264            set category "Expires $expires"
    61916265            set status $idinfo
     6266            set ipreal $rv(ipr)
     6267            set ymd [clock format $attrs(.PARSEDDATE) -format "%Y%m%d" \
     6268                           -gmt true]
     6269            if {($ymd >= "20091201") \
     6270                    && ![string compare $ipreal pre5378Trust200902]} {
     6271                set ipreal trust200902
     6272            }
    61926273            regsub -all -- "&" [lindex [lindex $iprstatus \
    61936274                                              [lsearch0 $iprstatus \
    6194                                                         $rv(ipr)]] 1] \
     6275                                                        $ipreal]] 1] \
    61956276                        "\\\\\\&" ipr
    61966277            regsub -all -- %IPR% $status $ipr status
     
    63206401    }
    63216402
    6322     front_${mode}_begin $left $right $top $bottom $title $status $copying \
    6323                         $keywords $rv(xml:lang)
     6403    front_${mode}_begin $left $right $top $bottom $title $keywords $rv(xml:lang)
     6404
     6405    if {[string compare $rv(number) ""]} {
     6406      set cutoff 20090701
     6407    } else {
     6408      set cutoff 20091201
     6409    }
     6410
     6411    if {([catch { clock format $attrs(.PARSEDDATE) -format %Y%m%d \
     6412                               -gmt true } ymd]) \
     6413            || ($ymd < "$cutoff")} {
     6414        set options(.ABSTRACT1ST) 0
     6415        write_status_${mode} $status $copying 0
     6416    } else {
     6417        set options(.ABSTRACT1ST) 1
     6418        set attrs(.STATUS) $status
     6419        set attrs(.COPYING) $copying
     6420        set elem($elemX) [array get attrs]
     6421    }
    63246422}
    63256423
     
    63306428    global mode
    63316429    global crefs
     6430
     6431    array set attrs $elem($elemX)
     6432    if {[info exists attrs(.STATUS)]} {
     6433        write_status_${mode} $attrs(.STATUS) $attrs(.COPYING) 1
     6434    }
    63326435
    63336436    set toc ""
     
    77807883}
    77817884
    7782 proc front_txt_begin {left right top bottom title status copying keywords
    7783                       lang} {
     7885proc front_txt_begin {left right top bottom title keywords lang} {
    77847886    global options copyrightP
    77857887    global header footer lineno pageno blankP
     
    78287930
    78297931    set indent $page_basic_indent
     7932}
     7933
     7934proc write_status_txt {status copying afterP} {
     7935    global options copyrightP iprP
     7936
     7937    if {$afterP} {
     7938        write_line_txt "" -1
     7939    }
    78307940
    78317941    if {!$options(.PRIVATE)} {
     
    80238133    global options
    80248134
    8025     if {!$options(.COMPACT) || ![have_lines 4]} {
     8135    if {(!$options(.COMPACT) && !$options(.ABSTRACT1ST)) || ![have_lines 4]} {
    80268136        end_page_txt
    80278137    } else {
     
    1048310593#               }}}4 CSS style-sheet
    1048410594
    10485 proc front_html_begin {left right top bottom title status copying keywords
    10486                        lang} {
     10595proc front_html_begin {left right top bottom title keywords lang} {
    1048710596    global prog prog_version prog_url
    1048810597    global options copyrightP
     
    1058010689    }
    1058110690    write_html "</h1>"
     10691}
     10692
     10693proc write_status_html {status copying afterP} {
     10694    global options copyrightP iprP
    1058210695
    1058310696    if {!$options(.PRIVATE)} {
     
    1210412217    authors_nr $authors
    1210512218
    12106 puts "nr copyrightP $copyrightP"
    1210712219    if {(!$options(.PRIVATE)) && $copyrightP > 0} {
    1210812220        end_page_nr
     
    1221412326}
    1221512327
    12216 proc front_nr_begin {left right top bottom title status copying keywords
    12217                      lang} {
     12328proc front_nr_begin {left right top bottom title keywords lang} {
    1221812329    global prog prog_version
    1221912330    global options copyrightP
     
    1228112392
    1228212393    condwrite_in_nr $page_basic_indent 1
     12394}
     12395
     12396proc write_status_nr {status copying afterP} {
     12397    global options copyrightP iprP
     12398
     12399    if {$afterP} {
     12400        write_line_nr "" -1
     12401
     12402        condwrite_in_nr $page_basic_indent 1
     12403    }
    1228312404
    1228412405    if {!$options(.PRIVATE)} {
     
    1231712438    global options
    1231812439
    12319     if {!$options(.COMPACT) || ![have_lines 4]} {
     12440    if {(!$options(.COMPACT) && !$options(.ABSTRACT1ST)) || ![have_lines 4]} {
    1232012441        end_page_nr
    1232112442    } else {
Note: See TracChangeset for help on using the changeset viewer.