-
Notifications
You must be signed in to change notification settings - Fork 4
/
rfc2629.xslt
3869 lines (3292 loc) · 139 KB
/
rfc2629.xslt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!--
XSLT transformation from RFC2629 XML format to HTML
Copyright (c) 2001-2005 Julian F. Reschke ([email protected])
placed into the public domain
change history:
2001-03-28 [email protected]
Code rearranged, generate numbered section anchors for paragraphs (t)
as well. Fixes in index handling.
2001-04-12 [email protected]
Moved HTML output into XHTML namespace.
2001-10-02 [email protected]
Fixed default location for RFCs and numbering of section references.
Support ?rfc editing processing instruction.
2001-10-07 [email protected]
Made telephone number links active.
2001-10-08 [email protected]
Support for vspace element.
2001-10-09 [email protected]
Experimental support for rfc-issue PI.
2001-11-11 [email protected]
Support rfc private PI. Removed bogus code reporting the WG in the header.
2001-12-17 [email protected]
Support title attribute on references element
2002-01-05 [email protected]
Support for list/@style="@format"
2002-01-09 [email protected]
Display "closed" RFC issues as deleted
2002-01-14 [email protected]
Experimentally and optionally parse XML encountered in artwork elements
(requires MSXSL).
2002-01-27 [email protected]
Some cleanup. Moved RFC issues from PIs into namespaced elements.
2002-01-29 [email protected]
Added support for sortrefs PI. Added support for figure names.
2002-02-07 [email protected]
Highlight parts of artwork which are too wide (72 characters).
2002-02-12 [email protected]
Code rearrangement for static texts. Fixes for section numbering.
TOC generation rewritten.
2002-02-15 [email protected]
Support for irefs in sections; support iref @primary=true
2002-03-03 [email protected]
Moved anchor prefix into a constant. Added sanity checks on user anchor
names.
2002-03-23 [email protected]
Bugfix in detection of matching org names when creating the header. Fixed
sorting in subitems.
2002-04-02 [email protected]
Fix TOC link HTML generation when no TOC is generated (created broken
HTML table code).
2002-04-03 [email protected]
Made rendering of references more tolerant re: missing parts.
2002-04-08 [email protected]
Fixed reference numbering when references are split into separate sections.
2002-04-16 [email protected]
Fix default namespace (shouldn't be set for HTML output method).
2002-04-19 [email protected]
Lowercase internal CSS selectors for Mozilla compliance. Do not put TOC
into ul element.
2002-04-21 [email protected]
Make numbered list inside numbered lists use alphanumeric numbering.
2002-05-05 [email protected]
Updated issue/editing support.
2002-05-15 [email protected]
Bugfix for section numbering after introduction of ed:replace
2002-06-21 [email protected]
When producing private documents, do not include document status, copyright etc.
2002-07-08 [email protected]
Fix xrefs to Appendices.
2002-07-19 fielding
Make artwork lightyellow for easier reading.
2002-10-09 fielding
Translate references title to anchor name to avoid non-uri characters.
2002-10-13 [email protected]
Support for tocdepth PI.
2002-11-03 [email protected]
Added temporariry workaround for Mozilla/Transformiix result tree fragment problem.
(search for 'http://bugzilla.mozilla.org/show_bug.cgi?id=143668')
2002-12-25 [email protected]
xref code: attempt to uppercase "section" and "appendix" when at the start
of a sentence.
2003-02-02 [email protected]
fixed code for vspace blankLines="0", enhanced display for list with "format" style,
got rid of HTML blockquote elements, added support for "hangIndent"
2003-04-10 [email protected]
experimental support for appendix and spanx elements
2003-04-19 [email protected]
fixed counting of list numbers in "format %" styles (one counter
per unique format string). Added more spanx styles.
2003-05-02 [email protected]
experimental texttable support
2003-05-02 fielding
Make mailto links optional (default = none) (jre: default and PI name changed)
2003-05-04 [email protected]
experimental support for HTML link elements; fix default for table header
alignment default
2003-05-06 [email protected]
support for "background" PI.
2003-05-11 [email protected]
change %c format to lowercase alphabetic. add support for keyword
elements (generate META tag). fix various HTML conformance problems.
added experimental support for role attribute. do not number paragraphs
in unnumbered sections. update boilerplate texts. support for
"iprnotified" PI. bugfix list numbering. strip whitespace when
building tel: URIs.
2003-05-12 [email protected]
more conformance fixes (layout moved into CSS, move lists and figures
out of para content, do not use tables for list formatting)
2003-05-13 [email protected]
add DC.Creator meta tag, refactoring
2003-05-16 [email protected]
put nbsps between "section" and section number (xref).
2003-05-18 [email protected]
author summary: add missing comma.
2003-06-06 [email protected]
fix index generation bug (transposed characters in key generation). Enhance
sentence start detection (xref starting a section was using lowercase
"section").
2003-06-22 [email protected]
exp. support for xref/@format. Add missing support for eref w/o content.
exp. support for annotations in reference elements. Code cleanup
reference table formatting.
2003-07-09 [email protected]
Another fix for DC.Creator meta tag creation based on RFC2731
2003-07-24 [email protected]
Fix namespace name for DC.Creator.
2003-08-06 [email protected]
Cleanup node-set support (only use exslt (saxon, xalan, libxslt) extension
functions; remove Transformix workarounds that stopped to work in Moz 1.4)
2003-08-09 [email protected]
Generate HTML lang tag.
2003-08-10 [email protected]
Map spanx/verb to HTML "samp" element. Fix author name display in
references (reverse surname/initials for last author), add "Ed.".
Fix internal bookmark generation.
2003-08-17 [email protected]
Add DCMI dates, identifiers and abstract. Add PI to suppress DCMI
generation. Do not add TOC entry to Copyright Statement when there is
none. Align RFC2629 PI names and parameter names. Change style for
inline URIs generated by eref. Add header and footer support.
Enhance CSS paging properties. Support topblock PI. Added hooks for
proper XHTML generation through separate XSLT. Enhance warning and
error messages. Add support for artwork image display. Table formatting
fixes (borders, thead continuation).
2003-08-18 [email protected]
Add workaround for MSXML4 node-set and Mozilla node-set issues (fallback
just displays are warning).
2003-10-06 [email protected]
Add workaround for broken pre/ins handling in Mozilla
(see <http://bugzilla.mozilla.org/show_bug.cgi?id=204401>). Make use
of cite attribute on ed:replace. CSS cleanup.
2003-10-08 [email protected]
Fix minor issue detecting the same org for the header (caused by IE's
non-standard whitespace handling). Fix default handling for /rfc/@category.
2003-11-09 [email protected]
Inherit ed:entered-by from ancestor elements. Change CSS color for inserted
text to green. Generate issues-list anchor. Do not complain about missing
targets when the xref element is below ed:del. Remove code that attempted
to distinguish section/Section when producing links - always use
uppercase. Fix date rendering for issue resolutions.
2003-11-29 [email protected]
Fix color values for table backgrounds for issue rendering. Change
rendering of issue links to use inline-styles. Add colored issue markers to
issues.
2003-12-13 [email protected]
Fix inheritance of ed:entered-by attribute. Display note elements inside
change tracking as well.
2004-01-18 [email protected]
When PI compact = 'yes', make most CSS print page breaks conditional.
2004-02-20 [email protected]
Support for RFC3667 IPR changes (xml2rfc 1.22); see
<http://lists.xml.resource.org/pipermail/xml2rfc/2004-February/001088.html>.
2004-03-11 [email protected]
Add "(if approved)" to "updates" and "obsoletes" unless the document has
an RFC number.
2004-04-01 [email protected]
Fix RFC3667 output, see <http://lists.xml.resource.org/pipermail/xml2rfc/2004-April/001208.html>
2004-04-04 [email protected]
Add support for section/top attribute. Move references into plain
section container.
2004-04-06 [email protected]
Do not emit identical para anchors for deleted content.
2004-04-14 [email protected]
Fix references TOC generation when there are no references.
2004-04-24 [email protected]
Fix RFC3667 output, see <http://xml.resource.org/pipermail/xml2rfc/2004-April/001246.html>
2004-05-09 [email protected]
Add custom support for generating compound index documents. Add anchors
for each Index letter. Add experimental cref support. Fix conditional page
breaks before References section.
2004-05-16 [email protected]
Refactor external index generation.
2004-05-20 [email protected]
Rewrite anchor generation for comments.
2004-05-22 [email protected]
Enhance issues rendering (add links to changes).
2004-05-30 [email protected]
Allow single quote as delimiter in processing instructions as well. Move
block-level issue pointers to floats. Disable issue pointers for print
media. Add "purple numbers". Add hrefs to section headings. Add non-printing
index key letter list to start of index.
2004-06-01 [email protected]
Use ¶ instead of # for PNs.
2004-07-18 [email protected]
Add support for list style=letters (thanks Roy F.). Make PNs optional;
add new PI.
2004-09-05 [email protected]
Fix index links into unnumbered sections. Bring IPR boilerplate in-line
with xml2rfc 1.25. Add experimental CSS3 paged media support. Various
HTML fixes.
2004-09-21 [email protected]
Enhance checking of artwork width.
2004-09-26 [email protected]
Add check for unused references. Uppercase letters in list style letters
when nested into another list.
2004-10-10 [email protected]
Fix internal change track pointers.
2004-11-01 [email protected]
Allow change tracking on references (as a whole). Rewrite artwork handling
so that it allows change tracking inside artwork. Also allow a subset of
text markup inside artwork, such as xrefs (note this requires post-
processing the source to make it compliant to RFC2629bis).
2004-11-03 [email protected]
Enhanced placement of iref anchors.
2004-11-06 [email protected]
Index: display irefs that appeared (with primary=true) inside artwork elements
in a monospaced font.
2004-11-14 [email protected]
Add special code so that changes in section titles can be change-tracked.
2005-01-14 [email protected]
Bugfixes for HtmlToXhtml converter.
2005-01-22 [email protected]
Enhance generation of HTML h* elements (for Mozilla Outliner).
2005-01-31 [email protected]
Put vertical space around top-level TOC entries in TOC. Switch to
pt-based CSS. Re-arrange top section. Make hr elements reflect new-page
settings in TXT output (compact-PI). Fix page number in footer (CSS
print) and add some more experimental support for paged media (tested
with Prince 4.1 alpha). Rewrite TOC and Index generation to generate HTML
lists. Cleanup id generation for paragraphs. Reduce whitespace in output.
Fix vspace implementation. Use right/left dqoutes and copyright sign
where appropriate.
2005-02-04 [email protected]
Add <link> element to references section. Fix newly introduced bug
in references processing.
2005-02-05 [email protected]
Integrate various fixes/enhancements by Roy Fielding: spelling of
"Authors' Addresses", comma setting in references, position of "Authors"
section, optionally place authors addresses at end (PI), trailing dots
in section numbers, switch to verdana default font in CSS. Add
experimental support for centered artwork.
2005-02-09 [email protected]
Fixes in spacing and links of references section titles. Enhance sorting
in references when change tracking is in place. Re-add figure centering
support. Add missing 2nd part of "Author's Adresses" fix.
2005-02-25 [email protected]
Align section number format with xml2rfc1.29.
2005-03-28 [email protected]
Get rid of table elements in Author's section. Add experimental hCard
(<http://developers.technorati.com/wiki/hCard>) support.
2005-04-03 [email protected]
Add RFC3978-style IPR statement support.
2005-04-11 [email protected]
Cleanup author display. hCard related fixes.
2005-05-07 [email protected]
Minor fixes to allow change tracking in doc title. Add experimental
support for table border styles. CSS cleanup.
2005-06-18 [email protected]
Implement missing support for references to texttables.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:exslt="http://exslt.org/common"
xmlns:myns="mailto:[email protected]?subject=rcf2629.xslt"
xmlns:ed="http://greenbytes.de/2002/rfcedit"
exclude-result-prefixes="msxsl exslt myns ed"
>
<xsl:strip-space elements="back front list middle rfc section"/>
<xsl:output method="html" encoding="iso-8859-1" version="4.0" doctype-public="-//W3C//DTD HTML 4.01//EN" indent="no"/>
<!-- process some of the processing instructions supported by Marshall T. Rose's
xml2rfc sofware, see <http://xml.resource.org/> -->
<!-- delimiters in PIs -->
<xsl:variable name="quote-chars">"'</xsl:variable>
<!-- rfc comments PI -->
<xsl:param name="xml2rfc-comments"
select="substring-after(
translate(/processing-instruction('rfc')[contains(.,'comments=')], concat($quote-chars,' '), ''),
'comments=')"
/>
<!-- rfc compact PI -->
<xsl:param name="xml2rfc-compact"
select="substring-after(
translate(/processing-instruction('rfc')[contains(.,'compact=')], concat($quote-chars,' '), ''),
'compact=')"
/>
<!-- rfc footer PI -->
<xsl:param name="xml2rfc-footer"
select="substring-after(
translate(/processing-instruction('rfc')[contains(.,'footer=')], concat($quote-chars,' '), ''),
'footer=')"
/>
<!-- rfc header PI -->
<xsl:param name="xml2rfc-header"
select="substring-after(
translate(/processing-instruction('rfc')[contains(.,'header=')], concat($quote-chars,' '), ''),
'header=')"
/>
<!-- rfc inline PI -->
<xsl:param name="xml2rfc-inline"
select="substring-after(
translate(/processing-instruction('rfc')[contains(.,'inline=')], concat($quote-chars,' '), ''),
'inline=')"
/>
<!-- include a table of contents if a processing instruction <?rfc?>
exists with contents toc="yes". Can be overriden by an XSLT parameter -->
<xsl:param name="xml2rfc-toc"
select="substring-after(
translate(/processing-instruction('rfc')[contains(.,'toc=')], concat($quote-chars,' '), ''),
'toc=')"
/>
<!-- optional tocdepth-->
<xsl:param name="xml2rfc-tocdepth"
select="substring-after(
translate(/processing-instruction('rfc')[contains(.,'tocdepth=')], concat($quote-chars,' '), ''),
'tocdepth=')"
/>
<xsl:variable name="parsedTocDepth">
<xsl:choose>
<xsl:when test="$xml2rfc-tocdepth='1'">1</xsl:when>
<xsl:when test="$xml2rfc-tocdepth='2'">2</xsl:when>
<xsl:when test="$xml2rfc-tocdepth='3'">3</xsl:when>
<xsl:when test="$xml2rfc-tocdepth='4'">4</xsl:when>
<xsl:when test="$xml2rfc-tocdepth='5'">5</xsl:when>
<xsl:otherwise>99</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- suppress top block if a processing instruction <?rfc?>
exists with contents tocblock="no". Can be overriden by an XSLT parameter -->
<xsl:param name="xml2rfc-topblock"
select="substring-after(
translate(/processing-instruction('rfc')[contains(.,'topblock=')], concat($quote-chars,' '), ''),
'topblock=')"
/>
<!-- use symbolic reference names instead of numeric ones if a processing instruction <?rfc?>
exists with contents symrefs="yes". Can be overriden by an XSLT parameter -->
<xsl:param name="xml2rfc-symrefs"
select="substring-after(
translate(/processing-instruction('rfc')[contains(.,'symrefs=')], concat($quote-chars,' '), ''),
'symrefs=')"
/>
<!-- sort references if a processing instruction <?rfc?>
exists with contents sortrefs="yes". Can be overriden by an XSLT parameter -->
<xsl:param name="xml2rfc-sortrefs"
select="substring-after(
translate(/processing-instruction('rfc')[contains(.,'sortrefs=')], concat($quote-chars,' '), ''),
'sortrefs=')"
/>
<!-- insert editing marks if a processing instruction <?rfc?>
exists with contents editing="yes". Can be overriden by an XSLT parameter -->
<xsl:param name="xml2rfc-editing"
select="substring-after(
translate(/processing-instruction('rfc')[contains(.,'editing=')], concat($quote-chars,' '), ''),
'editing=')"
/>
<!-- make it a private paper -->
<xsl:param name="xml2rfc-private"
select="substring-after(
translate(/processing-instruction('rfc')[contains(.,'private=')], concat($quote-chars,' '), ''),
'private=')"
/>
<!-- background image? -->
<xsl:param name="xml2rfc-background"
select="substring-after(
translate(/processing-instruction('rfc')[contains(.,'background=')], $quote-chars, ''),
'background=')"
/>
<!-- extension for XML parsing in artwork -->
<xsl:param name="xml2rfc-ext-parse-xml-in-artwork"
select="substring-after(
translate(/processing-instruction('rfc-ext')[contains(.,'parse-xml-in-artwork=')], concat($quote-chars,' '), ''),
'parse-xml-in-artwork=')"
/>
<!-- extension for excluding DCMI properties in meta tag (RFC2731) -->
<xsl:param name="xml2rfc-ext-support-rfc2731"
select="substring-after(
translate(/processing-instruction('rfc-ext')[contains(.,'support-rfc2731=')], concat($quote-chars,' '), ''),
'support-rfc2731=')"
/>
<!-- extension for allowing markup inside artwork -->
<xsl:param name="xml2rfc-ext-allow-markup-in-artwork"
select="substring-after(
translate(/processing-instruction('rfc-ext')[contains(.,'allow-markup-in-artwork=')], concat($quote-chars,' '), ''),
'allow-markup-in-artwork=')"
/>
<!-- position of author's section -->
<xsl:param name="xml2rfc-ext-authors-section"
select="substring-after(
translate(/processing-instruction('rfc-ext')[contains(.,'authors-section=')], concat($quote-chars,' '), ''),
'authors-section=')"
/>
<!-- trailing dots in section numbers -->
<xsl:param name="xml2rfc-ext-sec-no-trailing-dots"
select="substring-after(
translate(/processing-instruction('rfc-ext')[contains(.,'sec-no-trailing-dots=')], concat($quote-chars,' '), ''),
'sec-no-trailing-dots=')"
/>
<!-- choose whether or not to do mailto links -->
<xsl:param name="xml2rfc-linkmailto"
select="substring-after(
translate(/processing-instruction('rfc')[contains(.,'linkmailto=')], concat($quote-chars,' '), ''),
'linkmailto=')"
/>
<!-- iprnotified switch -->
<xsl:param name="xml2rfc-iprnotified"
select="substring-after(
translate(/processing-instruction('rfc')[contains(.,'iprnotified=')], concat($quote-chars,' '), ''),
'iprnotified=')"
/>
<!-- URL prefix for RFCs. -->
<xsl:param name="rfcUrlPrefix" select="'http://www.ietf.org/rfc/rfc'" />
<!-- warning re: absent node-set ext. function -->
<xsl:variable name="node-set-warning">
This stylesheet requires either an XSLT-1.0 processor with node-set()
extension function, or an XSLT-2.0 processor. Therefore, parts of the
document couldn't be displayed.
</xsl:variable>
<!-- build help keys for indices -->
<xsl:key name="index-first-letter"
match="iref"
use="translate(substring(@item,1,1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')" />
<xsl:key name="index-item"
match="iref"
use="@item" />
<xsl:key name="index-item-subitem"
match="iref"
use="concat(@item,'..',@subitem)" />
<!-- character translation tables -->
<xsl:variable name="lcase" select="'abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="ucase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
<xsl:variable name="plain" select="' #/ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
<xsl:variable name="touri" select="'___abcdefghijklmnopqrstuvwxyz'" />
<!-- prefix for automatically generated anchors -->
<xsl:variable name="anchor-prefix" select="'rfc'" />
<!-- IPR version switch -->
<xsl:variable name="ipr-rfc3667" select="(/rfc/@number > 3708) or not((/rfc/@ipr = 'full2026') or
(/rfc/@ipr = 'noDerivativeWorks2026') or (/rfc/@ipr = 'noDerivativeWorksNow') or (/rfc/@ipr = 'none'))" />
<!-- Templates for the various elements of rfc2629.dtd -->
<xsl:template match="text()[not(ancestor::artwork)]">
<xsl:variable name="starts-with-ws" select="translate(substring(.,1,1),'	  ','')"/>
<xsl:variable name="ends-with-ws" select="translate(substring(.,string-length(.),1),'	  ','')"/>
<!--<xsl:message> Orig: "<xsl:value-of select="."/>"</xsl:message>
<xsl:message>Start: "<xsl:value-of select="$starts-with-ws"/>"</xsl:message>
<xsl:message> End: "<xsl:value-of select="$ends-with-ws"/>"</xsl:message> -->
<xsl:if test="$starts-with-ws='' and preceding-sibling::node()">
<xsl:text> </xsl:text>
</xsl:if>
<xsl:value-of select="normalize-space(.)"/>
<xsl:if test="$ends-with-ws='' and following-sibling::node()">
<xsl:text> </xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="abstract">
<h1 id="{$anchor-prefix}.abstract"><a href="#{$anchor-prefix}.abstract">Abstract</a></h1>
<xsl:apply-templates />
</xsl:template>
<msxsl:script language="JScript" implements-prefix="myns">
function parseXml(str) {
var doc = new ActiveXObject ("MSXML2.DOMDocument");
doc.async = false;
if (doc.loadXML (str)) return "";
return doc.parseError.reason + "\n" + doc.parseError.srcText + " (" + doc.parseError.line + "/" + doc.parseError.linepos + ")";
}
</msxsl:script>
<xsl:template match="artwork">
<xsl:if test="not(ancestor::ed:del) and $xml2rfc-ext-parse-xml-in-artwork='yes' and function-available('myns:parseXml')">
<xsl:if test="contains(.,'<?xml')">
<xsl:variable name="body" select="substring-after(substring-after(.,'<?xml'),'?>')" />
<xsl:if test="$body!='' and myns:parseXml($body)!=''">
<table style="background-color: red; border-width: thin; border-style: solid; border-color: black;">
<tr><td>
XML PARSE ERROR:
<pre><xsl:value-of select="myns:parseXml($body)" /></pre>
</td></tr></table>
</xsl:if>
</xsl:if>
<xsl:if test="@ed:parse-xml-after">
<xsl:if test="myns:parseXml(string(.))!=''">
<table style="background-color: red; border-width: thin; border-style: solid; border-color: black;">
<tr><td>
XML PARSE ERROR:
<pre><xsl:value-of select="myns:parseXml(string(.))" /></pre>
</td></tr></table>
</xsl:if>
</xsl:if>
</xsl:if>
<xsl:variable name="display">
<xsl:choose>
<xsl:when test="$xml2rfc-ext-allow-markup-in-artwork='yes'">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="@align='right'">
<div style="display:table; margin-left: auto; margin-right: 0pt; width: 0pt;">
<pre style="margin-left: 0em;">
<xsl:copy-of select="$display"/>
</pre>
</div>
</xsl:when>
<xsl:when test="@align='center'">
<div style="display:table; margin-left: auto; margin-right: auto; width: 0pt;">
<pre style="margin-left: 0em;">
<xsl:copy-of select="$display"/>
</pre>
</div>
</xsl:when>
<xsl:otherwise>
<pre>
<xsl:copy-of select="$display"/>
</pre>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="check-artwork-width">
<xsl:with-param name="content"><xsl:apply-templates/></xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="check-artwork-width">
<xsl:param name="content"/>
<xsl:choose>
<xsl:when test="not(contains($content,' '))">
<xsl:if test="string-length($content) > 69">
<xsl:message>artwork line too long: <xsl:value-of select="$content"/></xsl:message>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="start" select="substring-before($content,' ')"/>
<xsl:variable name="end" select="substring-after($content,' ')"/>
<xsl:if test="string-length($start) > 69">
<xsl:message>artwork line too long: <xsl:value-of select="$start"/></xsl:message>
</xsl:if>
<xsl:call-template name="check-artwork-width">
<xsl:with-param name="content" select="$end"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="artwork[@src and starts-with(@type,'image/')]">
<img src="{@src}" alt="{.}">
<xsl:copy-of select="@width|@height"/>
</img>
</xsl:template>
<xsl:template match="author">
<address class="vcard">
<span class="vcardline">
<span class="fn">
<xsl:value-of select="@fullname" />
</span>
<xsl:if test="@role">
(<xsl:value-of select="@role" />)
</xsl:if>
<!-- components of name (hidden from display -->
<span class="n" style="display: none">
<span class="Family-Name"><xsl:value-of select="@surname"/></span>
<!-- given-name family-name -->
<xsl:if test="@surname=substring(@fullname,1 + string-length(@fullname) - string-length(@surname))">
<span class="Given-Name"><xsl:value-of select="normalize-space(substring(@fullname,1,string-length(@fullname) - string-length(@surname)))"/></span>
</xsl:if>
<!-- family-name given-name -->
<xsl:if test="starts-with(@fullname,@surname)">
<span class="Given-Name"><xsl:value-of select="normalize-space(substring-after(@fullname,@surname))"/></span>
</xsl:if>
</span>
</span>
<span class="org vcardline">
<xsl:value-of select="organization" />
</span>
<span class="adr vcardline">
<xsl:if test="address/postal/street!=''">
<span class="street Street-Address vcardline">
<xsl:for-each select="address/postal/street">
<xsl:value-of select="." />
</xsl:for-each>
</span>
</xsl:if>
<xsl:if test="address/postal/city|address/postal/region|address/postal/code">
<span class="vcardline">
<xsl:if test="address/postal/city"><span class="Locality"><xsl:value-of select="address/postal/city" /></span>, </xsl:if>
<xsl:if test="address/postal/region"><span class="Region"><xsl:value-of select="address/postal/region" /></span> </xsl:if>
<xsl:if test="address/postal/code"><span class="Postal-Code"><xsl:value-of select="address/postal/code" /></span></xsl:if>
</span>
</xsl:if>
<xsl:if test="address/postal/country">
<span class="Country vcardline"><xsl:value-of select="address/postal/country" /></span>
</xsl:if>
</span>
<xsl:if test="address/phone">
<span class="vcardline">
<xsl:text>Phone: </xsl:text>
<a href="tel:{translate(address/phone,' ','')}"><span class="tel"><span class="voice"><xsl:value-of select="address/phone" /></span></span></a>
</span>
</xsl:if>
<xsl:if test="address/facsimile">
<span class="vcardline">
<xsl:text>Fax: </xsl:text>
<a href="fax:{translate(address/facsimile,' ','')}"><span class="tel"><span class="fax"><xsl:value-of select="address/facsimile" /></span></span></a>
</span>
</xsl:if>
<xsl:if test="address/email">
<span class="vcardline">
<xsl:text>EMail: </xsl:text>
<a>
<xsl:if test="$xml2rfc-linkmailto!='no'">
<xsl:attribute name="href">mailto:<xsl:value-of select="address/email" /></xsl:attribute>
</xsl:if>
<span class="email"><xsl:value-of select="address/email" /></span>
</a>
</span>
</xsl:if>
<xsl:if test="address/uri">
<span class="vcardline">
<xsl:text>URI: </xsl:text>
<a href="{address/uri}" class="url"><xsl:value-of select="address/uri" /></a>
</span>
</xsl:if>
</address>
</xsl:template>
<xsl:template match="back">
<!-- add references section first, no matter where it appears in the
source document -->
<!-- as of April 2004, process from middle section
<xsl:apply-templates select="references" />
-->
<!-- add editorial comments -->
<xsl:if test="//cref and $xml2rfc-comments='yes' and $xml2rfc-inline!='yes'">
<xsl:call-template name="insertComments" />
</xsl:if>
<!-- next, add information about the document's authors -->
<xsl:if test="$xml2rfc-ext-authors-section!='end'">
<xsl:call-template name="insertAuthors" />
</xsl:if>
<!-- add all other top-level sections under <back> -->
<xsl:apply-templates select="*[not(self::references)]" />
<xsl:if test="$xml2rfc-ext-authors-section='end'">
<xsl:call-template name="insertAuthors" />
</xsl:if>
<xsl:if test="not($xml2rfc-private)">
<!-- copyright statements -->
<xsl:variable name="copyright"><xsl:call-template name="insertCopyright" /></xsl:variable>
<!-- emit it -->
<xsl:choose>
<xsl:when test="function-available('msxsl:node-set')">
<xsl:apply-templates select="msxsl:node-set($copyright)" />
</xsl:when>
<xsl:when test="function-available('exslt:node-set')">
<xsl:apply-templates select="exslt:node-set($copyright)" />
</xsl:when>
<xsl:otherwise>
<xsl:message><xsl:value-of select="$node-set-warning"/></xsl:message>
<p class="error"><xsl:value-of select="$node-set-warning"/></p>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<!-- insert the index if index entries exist -->
<xsl:if test="//iref">
<xsl:call-template name="insertIndex" />
</xsl:if>
</xsl:template>
<xsl:template match="eref[node()]">
<a href="{@target}"><xsl:apply-templates /></a>
</xsl:template>
<xsl:template match="eref[not(node())]">
<xsl:text><</xsl:text>
<a href="{@target}"><xsl:value-of select="@target" /></a>
<xsl:text>></xsl:text>
</xsl:template>
<xsl:template match="figure">
<xsl:if test="@anchor!=''">
<div id="{@anchor}"/>
</xsl:if>
<xsl:variable name="anch">
<xsl:call-template name="get-figure-anchor"/>
</xsl:variable>
<div id="{$anch}" />
<xsl:apply-templates />
<xsl:if test="@title!='' or @anchor!=''">
<xsl:variable name="n"><xsl:number level="any" count="figure[@title!='' or @anchor!='']" /></xsl:variable>
<p class="figure">Figure <xsl:value-of select="$n"/><xsl:if test="@title!=''">: <xsl:value-of select="@title" /></xsl:if></p>
</xsl:if>
</xsl:template>
<xsl:template match="front">
<xsl:if test="$xml2rfc-topblock!='no'">
<!-- collect information for left column -->
<xsl:variable name="leftColumn">
<xsl:call-template name="collectLeftHeaderColumn" />
</xsl:variable>
<!-- collect information for right column -->
<xsl:variable name="rightColumn">
<xsl:call-template name="collectRightHeaderColumn" />
</xsl:variable>
<!-- insert the collected information -->
<table summary="header information" class="header" border="0" cellpadding="1" cellspacing="1">
<xsl:choose>
<xsl:when test="function-available('msxsl:node-set')">
<xsl:call-template name="emitheader">
<xsl:with-param name="lc" select="msxsl:node-set($leftColumn)" />
<xsl:with-param name="rc" select="msxsl:node-set($rightColumn)" />
</xsl:call-template>
</xsl:when>
<xsl:when test="function-available('exslt:node-set')">
<xsl:call-template name="emitheader">
<xsl:with-param name="lc" select="exslt:node-set($leftColumn)" />
<xsl:with-param name="rc" select="exslt:node-set($rightColumn)" />
</xsl:call-template>