- Timestamp:
- 01/04/10 07:49:35 (12 years ago)
- Location:
- xml2rfc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
xml2rfc/rfc2629.dtd
r723 r799 115 115 iprExtract IDREF #IMPLIED 116 116 submissionType 117 (IETF| independent) "IETF"117 (IETF|IAB|IRTF|independent) "IETF" 118 118 docName %ATEXT; #IMPLIED 119 119 xml:lang %ATEXT; "en"> -
xml2rfc/xml2rfc.tcl
r723 r799 12 12 global prog prog_version prog_url prog_ack 13 13 set prog "xml2rfc" 14 set prog_version "v1.3 4"14 set prog_version "v1.35" 15 15 set prog_url "http://xml.resource.org/" 16 16 set prog_ack \ … … 4233 4233 4234 4234 {trust200902 4235 "This Internet-Draft is submitted to IETFin full4235 "This Internet-Draft is submitted %TOIETF% in full 4236 4236 conformance with the provisions of BCP 78 and BCP 79."} 4237 4237 4238 4238 {noModificationTrust200902 4239 "This Internet-Draft is submitted to IETFin full4239 "This Internet-Draft is submitted %TOIETF% in full 4240 4240 conformance with the provisions of BCP 78 and BCP 79. 4241 4241 This document may not be modified, and derivative works of it may … … 4244 4244 4245 4245 {noDerivativesTrust200902 4246 "This Internet-Draft is submitted to IETFin full4246 "This Internet-Draft is submitted %TOIETF% in full 4247 4247 conformance with the provisions of BCP 78 and BCP 79. 4248 4248 This document may not be modified, and derivative works of it may … … 4250 4250 4251 4251 {pre5378Trust200902 4252 "This Internet-Draft is submitted to IETFin full4252 "This Internet-Draft is submitted %TOIETF% in full 4253 4253 conformance with the provisions of BCP 78 and BCP 79. 4254 4254 This document may contain material from IETF Documents or IETF … … 4346 4346 if {![catch { set attrs(submissionType) }]} { 4347 4347 switch -- $attrs(submissionType) { 4348 IETF - independent {}4348 IETF - IRTF - IAB - independent {} 4349 4349 default { 4350 4350 unexpected error \ … … 5336 5336 5337 5337 "The limited permissions granted above are perpetual and will not be 5338 revoked by the Internet Society or its successors or assign ees."5338 revoked by the Internet Society or its successors or assigns." 5339 5339 5340 5340 "This document and the information contained herein is provided on an … … 5491 5491 the IETF Administrative Support Activity (IASA)." 5492 5492 5493 5494 # get the publication date in seconds; returns 0 when not available 5495 5496 proc get_publication_date_seconds {date} { 5497 global elem 5498 5499 array set dv $elem($date) 5500 5501 set three [clock format [clock seconds] -format "%B %Y %d"] 5502 5503 if {[catch { set dv(year) }]} { 5504 set dv(year) [lindex $three 1] 5505 } 5506 if {[catch { set dv(month) }]} { 5507 if {(![string compare $dv(year) [lindex $three 1]])} { 5508 set dv(month) [lindex $three 0] 5509 set dv(day) [string trimleft [lindex $three 2] 0] 5510 } else { 5511 unexpected error "I can't synthesize a date in $dv(year)" 5512 } 5513 } elseif {[catch { set dv(day) }]} { 5514 if {(![string compare $dv(month) [lindex $three 0]]) \ 5515 && (![string compare $dv(year) [lindex $three 1]])} { 5516 set dv(day) [string trimleft [lindex $three 2] 0] 5517 } 5518 } 5519 set elem($date) [array get dv] 5520 5521 if {[catch { set day $dv(day) }]} { 5522 set day 1 5523 } 5524 if {[catch {set secs [clock scan "$dv(month) $day, $dv(year)" -gmt true]}]} { 5525 set secs 0 5526 } 5527 5528 return $secs 5529 } 5530 5531 5493 5532 # }}}2 Other IPR texts 5494 5533 # {{{2 Pass 2 (and subsequent) stuff for the whole document … … 5499 5538 global copyshort copyshort1 copyshort2 copyshort3 copyshortTrust200811 \ 5500 5539 copyshortTrust200909 copyshortTrust200902 \ 5501 co pyshortTrust200902esc copyshortTrust200909esc5540 codeComponents200909 pre5378escapeClause 5502 5541 global funding funding1 funding2 5503 5542 global backP … … 5527 5566 } 5528 5567 5529 set newP 8 5568 set newP 9 5569 if {![info exists fv(.PARSEDDATE)]} { 5570 set date [find_element date $fv(.CHILDREN)] 5571 set secs [get_publication_date_seconds $date] 5572 set fv(.PARSEDDATE) $secs 5573 set elem($front) [array get fv] 5574 } 5530 5575 if {[catch { clock format $fv(.PARSEDDATE) -format "%Y%m%d" -gmt true } \ 5531 5576 ymd]} { … … 5534 5579 set ymd "" 5535 5580 } 5536 5581 5537 5582 if {[string compare $attrs(number) ""]} { 5538 5583 if {$attrs(number) <= 2499} { … … 5557 5602 # for the RFCs listed above 5558 5603 set newP 7 5604 } elseif {$ymd < "20100101"} { 5605 set newP 8 5559 5606 } 5560 5607 } elseif {[string compare $attrs(ipr) ""]} { … … 5567 5614 # TLP 2009 09 copyright notice beginning with Nov 2009 5568 5615 set newP 7 5616 } elseif {$ymd < "20100401"} { 5617 # TLP 2010 01 copyright notice beginning with Apr 2010 5618 set newP 8 5569 5619 } 5570 5620 # note: no support for 2008 11 TLP text in IDs 5571 5621 } 5572 5622 5573 if {$newP == 8} { 5623 if {$newP == 9} { 5624 set copyshort $copyshortTrust200909 5625 5626 if {![catch { set attrs(submissionType) }]} { 5627 switch -- $attrs(submissionType) { 5628 IETF { 5629 regsub -all -- %CODECOMPONENTS% $copyshort $codeComponents200909 copyshort 5630 # in the code components statement, say "Simplied BSD License" 5631 regsub -all -- %SIMPLIFIED% $copyshort "Simplified " copyshort 5632 } 5633 default { 5634 regsub -all -- %CODECOMPONENTS% $copyshort "" copyshort 5635 } 5636 } 5637 } 5638 5574 5639 # RFCs: include escape clause in Copyright Notice 5575 5640 # IDs: include in Status Of This Memo (produced elsewhere), for date before Nov 2009 5576 5641 if {![string compare $attrs(ipr) "pre5378Trust200902"] && \ 5577 5642 ([string compare $attrs(number) ""] || $ymd >= "20091101")} { 5578 set copyshort $copyshortTrust200909esc 5579 } else { 5580 set copyshort $copyshortTrust200909 5643 lappend copyshort $pre5378escapeClause 5644 } 5645 set funding "" 5646 set copyrightP -1 5647 set iprP 0 5648 } elseif {$newP == 8} { 5649 set copyshort $copyshortTrust200909 5650 # pre-201004: append code component clause unconditionally 5651 regsub -all -- %CODECOMPONENTS% $copyshort $codeComponents200909 copyshort 5652 # in the code components statement, say "BSD License" 5653 regsub -all -- %SIMPLIFIED% $copyshort "" copyshort 5654 5655 # RFCs: include escape clause in Copyright Notice 5656 # IDs: include in Status Of This Memo (produced elsewhere), for date before Nov 2009 5657 if {![string compare $attrs(ipr) "pre5378Trust200902"] && \ 5658 ([string compare $attrs(number) ""] || $ymd >= "20091101")} { 5659 lappend copyshort $pre5378escapeClause 5581 5660 } 5582 5661 set funding "" … … 5584 5663 set iprP 0 5585 5664 } elseif {$newP == 7} { 5665 set copyshort $copyshortTrust200902 5586 5666 # RFCs: include escape clause in Copyright Notice 5587 5667 # IDs: include in Status Of This Memo (produced elsewhere) 5588 5668 if {![string compare $attrs(ipr) "pre5378Trust200902"] && \ 5589 5669 [string compare $attrs(number) ""]} { 5590 set copyshort $copyshortTrust200902esc 5591 } else { 5592 set copyshort $copyshortTrust200902 5670 lappend copyshort $pre5378escapeClause 5593 5671 } 5594 5672 set funding "" … … 5860 5938 set copylong $copylong3 5861 5939 } 5940 default { 5941 unexpected error \ 5942 "submissionType=\"$attrs(submissionType)\" unexpected for this boilerplate" 5943 } 5862 5944 } 5863 5945 set validity $validity1 … … 5869 5951 independent { 5870 5952 set copylong $copylong5 5953 } 5954 default { 5955 unexpected error \ 5956 "submissionType=\"$attrs(submissionType)\" unexpected for this boilerplate" 5871 5957 } 5872 5958 } … … 6002 6088 # {{{2 Front texts (either for the rfc or a reference) 6003 6089 6004 global copyshort copyshort1 copyshort2 idinfo id aburl idshurl6090 global copyshort copyshort1 copyshort2 idinfo idinfo2 idaburl idshurl 6005 6091 6006 6092 set idaburl "http://www.ietf.org/ietf/1id-abstracts.txt" … … 6044 6130 rights and restrictions with respect to this document."} 6045 6131 6046 set copyshortTrust200902esc \ 6047 {"Copyright (c) %YEAR% IETF Trust and the persons identified as the 6048 document authors. All rights reserved." 6049 6050 "This document is subject to BCP 78 and the IETF Trust's Legal 6051 Provisions Relating to IETF Documents in effect on the date of 6052 publication of this document (http://trustee.ietf.org/license-info). 6053 Please review these documents carefully, as they describe your 6054 rights and restrictions with respect to this document." 6055 6132 set pre5378escapeClause \ 6056 6133 "This document may contain material from IETF Documents or IETF 6057 6134 Contributions published or made publicly available before November … … 6064 6141 not be created outside the IETF Standards Process, except to format 6065 6142 it for publication as an RFC or to translate it into languages other 6066 than English." }6143 than English." 6067 6144 6068 6145 set copyshortTrust200909 \ … … 6075 6152 publication of this document. Please review these documents 6076 6153 carefully, as they describe your rights and restrictions with respect 6077 to this document. Code Components extracted from this document must 6154 to this document.%CODECOMPONENTS%"} 6155 6156 set codeComponents200909 \ 6157 " Code Components extracted from this document must 6078 6158 include Simplified BSD License text as described in Section 4.e of 6079 6159 the Trust Legal Provisions and are provided without warranty as 6080 described in the BSD License."} 6081 6082 set copyshortTrust200909esc \ 6083 {"Copyright (c) %YEAR% IETF Trust and the persons identified as the 6084 document authors. All rights reserved." 6085 6086 "This document is subject to BCP 78 and the IETF Trust's Legal 6087 Provisions Relating to IETF Documents 6088 (http://trustee.ietf.org/license-info) in effect on the date of 6089 publication of this document. Please review these documents 6090 carefully, as they describe your rights and restrictions with respect 6091 to this document. Code Components extracted from this document must 6092 include Simplified BSD License text as described in Section 4.e of 6093 the Trust Legal Provisions and are provided without warranty as 6094 described in the BSD License." 6095 6096 "This document may contain material from IETF Documents or IETF 6097 Contributions published or made publicly available before November 6098 10, 2008. The person(s) controlling the copyright in some of this 6099 material may not have granted the IETF Trust the right to allow 6100 modifications of such material outside the IETF Standards Process. 6101 Without obtaining an adequate license from the person(s) controlling 6102 the copyright in such materials, this document may not be modified 6103 outside the IETF Standards Process, and derivative works of it may 6104 not be created outside the IETF Standards Process, except to format 6105 it for publication as an RFC or to translate it into languages other 6106 than English."} 6160 described in the %SIMPLIFIED%BSD License." 6107 6161 6108 6162 # From the ietf/1id-guidelines.txt file, Section 5. … … 6129 6183 } 6130 6184 6185 # Shorter idinfo approved as an alternative by the IESG on 2010-1-5 and 6186 # announced on 2010-2-8: 6187 # http://www.ietf.org/mail-archive/web/ietf-announce/current/msg07008.html 6188 set idinfo2 { 6189 "%IPR%" 6190 6191 "Internet-Drafts are working documents of the Internet Engineering 6192 Task Force (IETF). Note that other groups may also distribute 6193 working documents as Internet-Drafts. The list of current 6194 Internet-Drafts is at http://datatracker.ietf.org/drafts/current/." 6195 6196 "Internet-Drafts are draft documents valid for a maximum of six months 6197 and may be updated, replaced, or obsoleted by other documents at any time. 6198 It is inappropriate to use Internet-Drafts as reference material or to cite 6199 them other than as “work in progress.”" 6200 6201 "This Internet-Draft will expire on %EXPIRES%." 6202 } 6203 6131 6204 # }}}2 Front texts (either for the rfc or a reference) 6132 6205 # {{{2 Remaining pass 2 (and subsequent) stuff … … 6137 6210 global options 6138 6211 global mode ofile 6139 global categories copyshort idinfo id aburl idshurl iprstatus6212 global categories copyshort idinfo idinfo2 idaburl idshurl iprstatus 6140 6213 global page_width center_fill_width 6141 6214 global depth … … 6156 6229 set date [find_element date $attrs(.CHILDREN)] 6157 6230 array set dv $elem($date) 6158 set three [clock format [clock seconds] -format "%B %Y %d"]6159 if {[catch { set dv(year) }]} {6160 set dv(year) [lindex $three 1]6161 }6162 if {[catch { set dv(month) }]} {6163 if {(![string compare $dv(year) [lindex $three 1]])} {6164 set dv(month) [lindex $three 0]6165 set dv(day) [string trimleft [lindex $three 2] 0]6166 } else {6167 unexpected error "I can't synthesize a date in $dv(year)"6168 }6169 } elseif {[catch { set dv(day) }]} {6170 if {(![string compare $dv(month) [lindex $three 0]]) \6171 && (![string compare $dv(year) [lindex $three 1]])} {6172 set dv(day) [string trimleft [lindex $three 2] 0]6173 }6174 }6175 set elem($date) [array get dv]6176 6231 6177 6232 array set rv $elem(1) … … 6199 6254 set day 1 6200 6255 } 6201 if {[catch {set secs [clock scan "$dv(month) $day, $dv(year)" -gmt true]}]} { 6202 set secs 0 6203 } 6204 set attrs(.PARSEDDATE) $secs 6205 set elem($elemX) [array get attrs] 6256 set secs $attrs(.PARSEDDATE) 6206 6257 6207 6258 if {[info exists rv(category)]} { … … 6287 6338 lappend left "Expires:$colonspace $expires" 6288 6339 set category "Expires $expires" 6289 set status $idinfo6290 6340 set ipreal $rv(ipr) 6291 6341 set ymd [clock format $attrs(.PARSEDDATE) -format "%Y%m%d" \ … … 6295 6345 set ipreal trust200902 6296 6346 } 6347 # Use the shorter alternative for the ID info for new IDs 6348 # starting April 1, 2010. 6349 if {$ymd >= 20100401} { 6350 set status $idinfo2 6351 } else { 6352 set status $idinfo 6353 } 6297 6354 regsub -all -- "&" [lindex [lindex $iprstatus \ 6298 6355 [lsearch0 $iprstatus \ 6299 6356 $ipreal]] 1] \ 6300 6357 "\\\\\\&" ipr 6358 6359 if {($ymd < "20100401")} { 6360 # insert "to IETF" for documents before Feb 01 2010 6361 regsub -all -- %TOIETF% $ipr "to IETF" ipr 6362 } else { 6363 regsub -all -- %TOIETF% $ipr "" ipr 6364 } 6365 6301 6366 regsub -all -- %IPR% $status $ipr status 6302 6367 if {![string compare $mode html]} { … … 10146 10211 global eatP 10147 10212 10148 if { $eatP < 0} {10213 if {($eatP < 0) && ![regexp -- {^[.,?!]} $text]} { 10149 10214 set text " $text" 10150 10215 } 10216 10151 10217 if {![string compare $buffer ""]} { 10152 10218 set buffer [format %*s $indent ""] 10153 10219 set buffer_align [current_align] 10154 10220 } 10221 # print_stack_trace 10155 10222 append buffer $text 10156 10223 … … 10170 10237 } 10171 10238 } 10239 } 10240 10241 # grab the current function name. Useful in debugging like this: 10242 # puts stderr "[get_current_function_name] your message goes here" 10243 proc get_current_function_name {} { 10244 return [info level -1]; 10245 } 10246 10247 # print the current stack trace 10248 proc print_stack_trace {} { 10249 set stack "" 10250 set level -1 10251 for { set x [expr {[info level] + $level}] } { $x > 0 } { incr x -1 } { 10252 append stack " called from [info level $x]\n" 10253 } 10254 puts stderr $stack 10172 10255 } 10173 10256 … … 10648 10731 pcdata_html [lindex $title 0] 10649 10732 write_html "</title>" 10650 if {$options(.PRIVATE)} {10651 write_html -nonewline "<meta http-equiv=\"Expires\" content=\""10652 write_html -nonewline [clock format [clock seconds] \10653 -format "%a, %d %b %Y %T +0000" \10654 -gmt true]10655 write_html "\">"10656 }10657 10733 10658 10734 # Begin new meta tags. … … 12988 13064 global eatP 12989 13065 12990 if { $eatP < 0} {13066 if {($eatP < 0) && ![regexp -- {^[.,?!]} $text]} { 12991 13067 set text " $text" 12992 13068 } … … 17679 17755 check_vrsn_idle 17680 17756 } result]} { 17681 if { [catch {package require Tk}]} {17757 if {![catch {package require Tk}]} { 17682 17758 catch { wm geometry . 10x10+-100+-100 } 17683 17759 catch { wm withdraw . }
Note: See TracChangeset
for help on using the changeset viewer.