Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

bootstrap RFC tooling

  • Loading branch information...
commit f3e3bbd807bfecada527648e683d5afad8ffdf2c 0 parents
@igrigorik authored
Showing with 109,337 additions and 0 deletions.
  1. +1 −0  .gitignore
  2. +57 −0 Makefile
  3. +140 −0 tools/rfc2629xslt/amazon-asin.xslt
  4. +330 −0 tools/rfc2629xslt/check-references.xslt
  5. +739 −0 tools/rfc2629xslt/clean-for-DTD.xslt
  6. +94 −0 tools/rfc2629xslt/extract-artwork.xslt
  7. +56 −0 tools/rfc2629xslt/extractExtRefs.xslt
  8. +44 −0 tools/rfc2629xslt/extractInlineCss.xslt
  9. +423 −0 tools/rfc2629xslt/gen-reference-graph.xslt
  10. +516 −0 tools/rfc2629xslt/gen-w3c-reference.xslt
  11. +82 −0 tools/rfc2629xslt/mkepub.sh
  12. +461 −0 tools/rfc2629xslt/rfc2629-ext.rnc
  13. +61 −0 tools/rfc2629xslt/rfc2629-other.ent
  14. +165 −0 tools/rfc2629xslt/rfc2629-xhtml.ent
  15. +312 −0 tools/rfc2629xslt/rfc2629.dtd
  16. +321 −0 tools/rfc2629xslt/rfc2629.rnc
  17. +7,309 −0 tools/rfc2629xslt/rfc2629.xslt
  18. +90 −0 tools/rfc2629xslt/rfc2629grddl.xslt
  19. +44 −0 tools/rfc2629xslt/rfc2629toEPXHTML.xslt
  20. +2,784 −0 tools/rfc2629xslt/rfc2629toFO.xslt
  21. +304 −0 tools/rfc2629xslt/rfc2629toHhc.xslt
  22. +68 −0 tools/rfc2629xslt/rfc2629toHhk.xslt
  23. +42 −0 tools/rfc2629xslt/rfc2629toHhp.xslt
  24. +107 −0 tools/rfc2629xslt/rfc2629toNcx.xslt
  25. +82 −0 tools/rfc2629xslt/rfc2629toOpf.xslt
  26. +7,158 −0 tools/rfc2629xslt/rfc2629toXHTML.xslt
  27. BIN  tools/rfc2629xslt/rfc2629xslt-fig1.png
  28. BIN  tools/rfc2629xslt/rfc2629xslt-fig2.png
  29. +1,016 −0 tools/rfc2629xslt/rfc2629xslt.html
  30. BIN  tools/rfc2629xslt/rfc2629xslt.pdf
  31. +1,422 −0 tools/rfc2629xslt/rfc2629xslt.txt
  32. +3,771 −0 tools/rfc2629xslt/rfc2629xslt.xml
  33. +7,309 −0 tools/rfc2629xslt/samples/rfc2629.xslt
  34. +374 −0 tools/rfc2629xslt/samples/sample.ipr.id.noDerivativesTrust200902.200909.test.xhtml
  35. +112 −0 tools/rfc2629xslt/samples/sample.ipr.id.noDerivativesTrust200902.200909.txt
  36. +23 −0 tools/rfc2629xslt/samples/sample.ipr.id.noDerivativesTrust200902.200909.xml
  37. +386 −0 tools/rfc2629xslt/samples/sample.ipr.id.noModification3978.200606.test.xhtml
  38. +168 −0 tools/rfc2629xslt/samples/sample.ipr.id.noModification3978.200606.txt
  39. +23 −0 tools/rfc2629xslt/samples/sample.ipr.id.noModification3978.200606.xml
  40. +374 −0 tools/rfc2629xslt/samples/sample.ipr.id.noModificationTrust200902.200909.test.xhtml
  41. +112 −0 tools/rfc2629xslt/samples/sample.ipr.id.noModificationTrust200902.200909.txt
  42. +23 −0 tools/rfc2629xslt/samples/sample.ipr.id.noModificationTrust200902.200909.xml
  43. +374 −0 tools/rfc2629xslt/samples/sample.ipr.id.pre5378Trust200902.200909.test.xhtml
  44. +112 −0 tools/rfc2629xslt/samples/sample.ipr.id.pre5378Trust200902.200909.txt
  45. +23 −0 tools/rfc2629xslt/samples/sample.ipr.id.pre5378Trust200902.200909.xml
  46. +375 −0 tools/rfc2629xslt/samples/sample.ipr.id.pre5378Trust200902.200912.test.xhtml
  47. +112 −0 tools/rfc2629xslt/samples/sample.ipr.id.pre5378Trust200902.200912.txt
  48. +23 −0 tools/rfc2629xslt/samples/sample.ipr.id.pre5378Trust200902.200912.xml
  49. +373 −0 tools/rfc2629xslt/samples/sample.ipr.id.pre5378Trust200902.201011.test.xhtml
  50. +112 −0 tools/rfc2629xslt/samples/sample.ipr.id.pre5378Trust200902.201011.txt
  51. +23 −0 tools/rfc2629xslt/samples/sample.ipr.id.pre5378Trust200902.201011.xml
  52. +112 −0 tools/rfc2629xslt/samples/sample.ipr.id.trust200811.201004.ind.txt
  53. +374 −0 tools/rfc2629xslt/samples/sample.ipr.id.trust200902.200909.test.xhtml
  54. +112 −0 tools/rfc2629xslt/samples/sample.ipr.id.trust200902.200909.txt
  55. +23 −0 tools/rfc2629xslt/samples/sample.ipr.id.trust200902.200909.xml
  56. +374 −0 tools/rfc2629xslt/samples/sample.ipr.id.trust200902.200911.test.xhtml
  57. +112 −0 tools/rfc2629xslt/samples/sample.ipr.id.trust200902.200911.txt
  58. +23 −0 tools/rfc2629xslt/samples/sample.ipr.id.trust200902.200911.xml
  59. +372 −0 tools/rfc2629xslt/samples/sample.ipr.id.trust200902.201006.iab.test.xhtml
  60. +112 −0 tools/rfc2629xslt/samples/sample.ipr.id.trust200902.201006.iab.txt
  61. +23 −0 tools/rfc2629xslt/samples/sample.ipr.id.trust200902.201006.iab.xml
  62. +372 −0 tools/rfc2629xslt/samples/sample.ipr.id.trust200902.201006.ietf.test.xhtml
  63. +112 −0 tools/rfc2629xslt/samples/sample.ipr.id.trust200902.201006.ietf.txt
  64. +23 −0 tools/rfc2629xslt/samples/sample.ipr.id.trust200902.201006.ietf.xml
  65. +372 −0 tools/rfc2629xslt/samples/sample.ipr.id.trust200902.201006.ind.test.xhtml
  66. +112 −0 tools/rfc2629xslt/samples/sample.ipr.id.trust200902.201006.ind.txt
  67. +23 −0 tools/rfc2629xslt/samples/sample.ipr.id.trust200902.201006.ind.xml
  68. +372 −0 tools/rfc2629xslt/samples/sample.ipr.id.trust200902.201006.irtf.test.xhtml
  69. +112 −0 tools/rfc2629xslt/samples/sample.ipr.id.trust200902.201006.irtf.txt
  70. +23 −0 tools/rfc2629xslt/samples/sample.ipr.id.trust200902.201006.irtf.xml
  71. +372 −0 tools/rfc2629xslt/samples/sample.ipr.id.trust200902.201006.test.xhtml
  72. +112 −0 tools/rfc2629xslt/samples/sample.ipr.id.trust200902.201006.txt
  73. +23 −0 tools/rfc2629xslt/samples/sample.ipr.id.trust200902.201006.xml
  74. +381 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200201.iprnotified.test.xhtml
  75. +168 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200201.iprnotified.txt
  76. +25 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200201.iprnotified.xml
  77. +380 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200201.test.xhtml
  78. +168 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200201.txt
  79. +24 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200201.xml
  80. +380 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200609.ind.test.xhtml
  81. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200609.ind.txt
  82. +24 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200609.ind.xml
  83. +384 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200609.test.xhtml
  84. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200609.txt
  85. +29 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200609.xml
  86. +374 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200808.test.xhtml
  87. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200808.txt
  88. +24 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200808.xml
  89. +368 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200812.nomod.test.xhtml
  90. +56 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200812.nomod.txt
  91. +24 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200812.nomod.xml
  92. +367 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200812.test.xhtml
  93. +56 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200812.txt
  94. +24 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200812.xml
  95. +367 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200906.test.xhtml
  96. +56 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200906.txt
  97. +23 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200906.xml
  98. +367 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200907.test.xhtml
  99. +56 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200907.txt
  100. +23 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200907.xml
  101. +367 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200909.test.xhtml
  102. +56 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200909.txt
  103. +23 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200909.xml
  104. +371 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200912.test.xhtml
  105. +56 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200912.txt
  106. +28 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.200912.xml
  107. +373 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.iab.exp.test.xhtml
  108. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.iab.exp.txt
  109. +26 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.iab.exp.xml
  110. +373 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.iab.hist.test.xhtml
  111. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.iab.hist.txt
  112. +26 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.iab.hist.xml
  113. +373 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.iab.inf.test.xhtml
  114. +56 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.iab.inf.txt
  115. +26 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.iab.inf.xml
  116. +373 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.bcp.c.test.xhtml
  117. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.bcp.c.txt
  118. +26 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.bcp.c.xml
  119. +374 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.exp.c.nomod.test.xhtml
  120. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.exp.c.nomod.txt
  121. +26 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.exp.c.nomod.xml
  122. +373 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.exp.c.test.xhtml
  123. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.exp.c.txt
  124. +26 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.exp.c.xml
  125. +373 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.exp.nc.test.xhtml
  126. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.exp.nc.txt
  127. +26 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.exp.nc.xml
  128. +373 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.hist.c.test.xhtml
  129. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.hist.c.txt
  130. +26 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.hist.c.xml
  131. +373 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.hist.nc.test.xhtml
  132. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.hist.nc.txt
  133. +26 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.hist.nc.xml
  134. +373 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.inf.c.test.xhtml
  135. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.inf.c.txt
  136. +26 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.inf.c.xml
  137. +373 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.inf.nc.test.xhtml
  138. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.inf.nc.txt
  139. +26 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.inf.nc.xml
  140. +373 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.std.c.test.xhtml
  141. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.std.c.txt
  142. +26 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.std.c.xml
  143. +26 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ietf.std.nc.xml
  144. +373 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ind.exp.test.xhtml
  145. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ind.exp.txt
  146. +27 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ind.exp.xml
  147. +373 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ind.hist.test.xhtml
  148. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ind.hist.txt
  149. +27 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ind.hist.xml
  150. +373 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ind.inf.test.xhtml
  151. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ind.inf.txt
  152. +27 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.ind.inf.xml
  153. +373 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.exp.c.test.xhtml
  154. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.exp.c.txt
  155. +27 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.exp.c.xml
  156. +373 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.exp.nc.test.xhtml
  157. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.exp.nc.txt
  158. +27 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.exp.nc.xml
  159. +373 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.exp.norg.test.xhtml
  160. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.exp.norg.txt
  161. +26 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.exp.norg.xml
  162. +373 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.hist.c.test.xhtml
  163. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.hist.c.txt
  164. +27 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.hist.c.xml
  165. +373 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.hist.nc.test.xhtml
  166. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.hist.nc.txt
  167. +27 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.hist.nc.xml
  168. +373 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.hist.norg.test.xhtml
  169. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.hist.norg.txt
  170. +26 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.hist.norg.xml
  171. +373 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.inf.c.test.xhtml
  172. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.inf.c.txt
  173. +27 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.inf.c.xml
  174. +373 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.inf.nc.test.xhtml
  175. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.inf.nc.txt
  176. +27 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.inf.nc.xml
  177. +373 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.inf.norg.test.xhtml
  178. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.inf.norg.txt
  179. +26 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.201001.irtf.inf.norg.xml
  180. +23 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.hab.xml
  181. +368 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.pre5378Trust200902.200912.test.xhtml
  182. +112 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.pre5378Trust200902.200912.txt
  183. +23 −0 tools/rfc2629xslt/samples/sample.ipr.rfc.pre5378Trust200902.200912.xml
  184. +457 −0 tools/rfc2629xslt/testcase.html
  185. +1,018 −0 tools/rfc2629xslt/testcase.xml
  186. +12,423 −0 tools/rfc2629xslt/w3c-references.html
  187. +31,344 −0 tools/rfc2629xslt/w3c-references.xml
  188. +51 −0 tools/rfc2629xslt/xsl11toAn.xslt
  189. +99 −0 tools/rfc2629xslt/xsl11toFop.xslt
  190. +100 −0 tools/rfc2629xslt/xsl11toXep.xslt
  191. +5 −0 tools/rfc2629xslt/xslt-test.xml
  192. +238 −0 tools/rfc2629xslt/xslt-test.xslt
  193. +22 −0 tools/xml2rfc/.xml2rfc.rc
  194. +26 −0 tools/xml2rfc/LICENSE
  195. +39 −0 tools/xml2rfc/Makefile
  196. +1,529 −0 tools/xml2rfc/README.html
  197. +1,736 −0 tools/xml2rfc/README.txt
Sorry, we could not display the entire diff because too many files (456) changed.
1  .gitignore
@@ -0,0 +1 @@
+.refcache
57 Makefile
@@ -0,0 +1,57 @@
+# Base directory for I-D
+ID_BASE = .
+
+saxpath = "/usr/local/share/saxon-b/saxon9.jar"
+saxon = java -classpath $(saxpath) net.sf.saxon.Transform -novw -l
+stylesheet = "$(ID_BASE)/tools/rfc2629xslt/rfc2629.xslt"
+xml2rfc = "$(ID_BASE)/tools/xml2rfc/xml2rfc.tcl"
+rfc2629dir = "tools\\/rfc2629xslt\\/"
+
+NAME = grigorik
+TITLE = ${NAME}-$(shell basename ${CURDIR})
+LATEST = $(shell (ls draft-${TITLE}-*.xml || echo "draft-${TITLE}-00.xml") | sort | tail -1)
+VERSION = $(shell basename ${LATEST} .xml | awk -F- '{print $$NF}')
+
+TARGET_XML = draft-$(TITLE)-$(VERSION).xml
+PREV_TXT = draft-$(TITLE)-$(shell printf "%.2d" `echo ${VERSION}-1 | bc`).txt
+NEXT_XML = draft-$(TITLE)-$(shell printf "%.2d" `echo ${VERSION}+1 | bc`).xml
+
+TARGET_HTML = $(TARGET_XML:.xml=.html)
+TARGET_TXT = $(TARGET_XML:.xml=.txt)
+TARGETS = $(TARGET_HTML) \
+ $(TARGET_TXT)
+
+.PHONY: all
+all: $(TARGETS)
+
+.PHONY: clean
+clean:
+ rm -f $(TARGETS)
+
+.PHONY: next
+next:
+ cp $(TARGET_XML) $(NEXT_XML)
+
+.PHONY: diff
+diff:
+ rfcdiff $(PREV_TXT) $(TARGET_TXT)
+
+.PHONY: idnits
+idnits: $(TARGET_TXT)
+ idnits $<
+
+%.html: %.xml
+ $(saxon) $< $(stylesheet) > $@
+
+%.txt: %.xml
+ $(xml2rfc) $< $@
+
+.PHONY: kramdown
+kramdown: draft.md
+ kramdown-rfc2629 draft.md > $(TARGET_XML)
+ xmllint --format $(TARGET_XML) > tmp
+ mv tmp $(TARGET_XML)
+ sed -i '' -e"s/rfc2629\.xslt/$(rfc2629dir)rfc2629.xslt/" $(TARGET_XML)
+ sed -i '' -e"s/rfc2629\.dtd/$(rfc2629dir)rfc2629.dtd/" $(TARGET_XML)
+ cat $(TARGET_XML) | perl -pe "s/<figure anchor=\"[^\"]+\">/<figure>/g" > tmp
+ mv tmp $(TARGET_XML)
140 tools/rfc2629xslt/amazon-asin.xslt
@@ -0,0 +1,140 @@
+<!--
+ Produce a reference entry based on an Amazon ASIN (ISBN) entry.
+
+ Copyright (c) 2006, Julian Reschke (julian.reschke@greenbytes.de)
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of Julian Reschke nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0"
+>
+
+<xsl:output indent="yes"/>
+
+<xsl:param name="asin" />
+
+<xsl:template match="/">
+ <xsl:variable name="uri" select="concat('http://xml.amazon.com/onca/xml3?t=webservices-20&amp;dev-t=foobar&amp;AsinSearch=',$asin,'&amp;type=heavy&amp;f=xml')" />
+ <xsl:variable name="res" select="document($uri)" />
+ <references>
+ <xsl:apply-templates select="$res/ProductInfo/Details" />
+ </references>
+</xsl:template>
+
+<xsl:template name="initials">
+ <xsl:param name="str"/>
+ <xsl:choose>
+ <xsl:when test="contains($str,' ')">
+ <xsl:call-template name="initials">
+ <xsl:with-param name="str">
+ <xsl:value-of select="substring-before($str,' ')"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template name="initials">
+ <xsl:with-param name="str">
+ <xsl:value-of select="substring-after($str,' ')"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise><xsl:value-of select="substring($str,1,1)"/>. </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template name="get-surname">
+ <xsl:param name="str"/>
+ <xsl:choose>
+ <xsl:when test="contains($str,' ')">
+ <xsl:call-template name="get-surname">
+ <xsl:with-param name="str" select="substring-after($str,' ')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$str"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="Author">
+ <xsl:variable name="surname">
+ <xsl:call-template name="get-surname">
+ <xsl:with-param name="str" select="normalize-space(.)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="givenname">
+ <xsl:value-of select="normalize-space(substring-before(.,$surname))"/>
+ </xsl:variable>
+ <author surname="{$surname}" fullname="{$givenname} {$surname}">
+ <xsl:attribute name="initials">
+ <xsl:call-template name="initials">
+ <xsl:with-param name="str" select="$givenname"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <organization/>
+ </author>
+</xsl:template>
+
+<xsl:template match="Details">
+ <reference target="urn:isbn:{Isbn}">
+ <front>
+ <xsl:apply-templates select="ProductName"/>
+ <xsl:apply-templates select="Authors/Author"/>
+ <xsl:apply-templates select="ReleaseDate"/>
+ </front>
+ <xsl:apply-templates select="Manufacturer"/>
+ </reference>
+</xsl:template>
+
+<xsl:template match="ReleaseDate">
+ <xsl:variable name="part1" select="normalize-space(substring-before(.,','))" />
+ <xsl:variable name="part2" select="normalize-space(substring-after(.,','))" />
+ <date year="{$part2}">
+ <xsl:choose>
+ <xsl:when test="contains($part1,' ')">
+ <xsl:attribute name="month">
+ <xsl:value-of select="substring-after($part1,' ')" />
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="month">
+ <xsl:value-of select="$part1" />
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </date>
+</xsl:template>
+
+<xsl:template match="ProductName">
+ <title><xsl:value-of select="."/></title>
+</xsl:template>
+
+<xsl:template match="Manufacturer">
+ <seriesInfo name="{.}" value="" />
+</xsl:template>
+
+
+
+</xsl:transform>
330 tools/rfc2629xslt/check-references.xslt
@@ -0,0 +1,330 @@
+<!--
+ Check RFC references (requires local copy of "rfc-index.xml",
+ available from <ftp://ftp.isi.edu/in-notes/rfc-index.xml> and
+ "tr.rdf", available from <http://www.w3.org/2002/01/tr-automation/tr.rdf>)
+
+ Copyright (c) 2006-2008, Julian Reschke (julian.reschke@greenbytes.de)
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of Julian Reschke nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="2.0"
+ xmlns:ed="http://greenbytes.de/2002/rfcedit"
+ xmlns:rfced="http://www.rfc-editor.org/rfc-index"
+ xmlns:x="http://purl.org/net/xml2rfc/ext"
+>
+
+<xsl:output method="text" encoding="UTF-8"/>
+
+<xsl:param name="intended-level">
+ <xsl:choose>
+ <xsl:when test="/rfc/@x:maturity-level"><xsl:value-of select="/rfc/@x:maturity-level"/></xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+</xsl:param>
+
+<xsl:param name="link-check" />
+
+<xsl:template match="/">
+ <xsl:if test="$intended-level!='' and ($intended-level!='proposed' and $intended-level!='draft' and $intended-level!='internet')">
+ <xsl:message terminate='yes'>intended-level: unsupported value (must be 'proposed', 'draft' or 'internet')!</xsl:message>
+ </xsl:if>
+
+ <xsl:if test="$link-check!='' and ($link-check!='no' and $link-check!='yes')">
+ <xsl:message terminate='yes'>link-check: unsupported value (must be 'yes' or 'no')!</xsl:message>
+ </xsl:if>
+
+ <xsl:for-each select="//references">
+ <xsl:variable name="title">
+ <xsl:choose>
+ <xsl:when test="@title">
+ <xsl:value-of select="@title"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>References</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:text>&#10;</xsl:text>
+ <xsl:value-of select="$title"/>
+ <xsl:text>:&#10;</xsl:text>
+ <xsl:for-each select=".//reference[not(ancestor::ed:del)]">
+ <xsl:sort select="@anchor"/>
+
+ <xsl:choose>
+ <xsl:when test="seriesInfo/@name='RFC'">
+ <xsl:apply-templates select="." mode="check-rfc"/>
+ </xsl:when>
+ <xsl:when test="(seriesInfo/@name='ID' or seriesInfo/@name='Internet-Draft') and starts-with(seriesInfo/@value,'draft-')">
+ <xsl:apply-templates select="." mode="check-internet-draft"/>
+ </xsl:when>
+ <xsl:when test="(seriesInfo/@name='W3C' or starts-with(seriesInfo/@name, 'W3C ') or starts-with(seriesInfo/@name, 'World Wide Web Consortium'))">
+ <xsl:apply-templates select="." mode="check-w3c"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@anchor"/>
+ <xsl:text>: not checked&#10;</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:for-each>
+
+ <xsl:variable name="targets2" select="//eref/@target | //reference/@target"/>
+ <xsl:variable name="targets" select="$targets2[starts-with(.,'http')]"/>
+ <xsl:if test="$targets and $link-check='yes'">
+ <xsl:text>&#10;Link Targets&#10;</xsl:text>
+ <xsl:choose>
+ <xsl:when test="function-available('unparsed-text-available')">
+ <xsl:for-each select="$targets">
+ <xsl:variable name="t">
+ <xsl:choose>
+ <xsl:when test="contains(.,'#')"><xsl:value-of select="substring-before(.,'#')"/></xsl:when>
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:text>&lt;</xsl:text>
+ <xsl:value-of select="$t"/>
+ <xsl:text>&gt;: </xsl:text>
+ <xsl:choose>
+ <xsl:when test="unparsed-text-available($t)">ok</xsl:when>
+ <xsl:otherwise>NOT AVAILABLE AS TEXT</xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>not checked (requires XSLT 2.0)</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+
+</xsl:template>
+
+<!-- helper -->
+<xsl:template name="base-name">
+ <xsl:param name="s"/>
+ <xsl:choose>
+ <xsl:when test="contains($s,'/') and substring-after($s,'/')!=''">
+ <xsl:call-template name="base-name">
+ <xsl:with-param name="s" select="substring-after($s,'/')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="translate($s,'/','')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<!-- check RFC reference -->
+<xsl:template match="reference" mode="check-rfc">
+ <xsl:variable name="title">
+ <xsl:choose>
+ <xsl:when test="ancestor::references/@title">
+ <xsl:value-of select="ancestor::references/@title"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>References</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="no" select="seriesInfo[@name='RFC']/@value" />
+ <xsl:variable name="id" select="concat('RFC',substring('000',string-length($no)),$no)" />
+ <xsl:value-of select="$id" />
+ <xsl:text>: </xsl:text>
+ <xsl:variable name="stat" select="document('rfc-index.xml')/*/rfced:rfc-entry[rfced:doc-id=$id]" />
+ <xsl:if test="$stat/rfced:current-status">
+ <xsl:text>[</xsl:text><xsl:value-of select="$stat/rfced:current-status"/><xsl:text>] </xsl:text>
+ </xsl:if>
+ <xsl:if test="$stat/rfced:is-also">
+ <xsl:text>(-> </xsl:text><xsl:value-of select="$stat/rfced:is-also/rfced:doc-id"/><xsl:text>) </xsl:text>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="$stat/rfced:obsoleted-by">
+ <xsl:text>obsoleted by </xsl:text>
+ <xsl:for-each select="$stat/rfced:obsoleted-by/rfced:doc-id">
+ <xsl:value-of select="."/>
+ <xsl:text> </xsl:text>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:when test="not($stat)">not found in RFC index!</xsl:when>
+
+ <!-- check the status of the normatively referred drafts -->
+ <xsl:when test="$intended-level='proposed' and ($title='References' or $title='Normative References') and
+ ($stat/rfced:publication-status='PROPOSED STANDARD' or $stat/rfced:publication-status='DRAFT STANDARD' or $stat/rfced:publication-status='STANDARD' or $stat/rfced:publication-status='BEST CURRENT PRACTICE')">
+ <!-- ok -->
+ </xsl:when>
+ <xsl:when test="$intended-level='draft' and ($title='References' or $title='Normative References') and
+ ($stat/rfced:publication-status='DRAFT STANDARD' or $stat/rfced:publication-status='STANDARD' or $stat/rfced:publication-status='BEST CURRENT PRACTICE')">
+ <!-- ok -->
+ </xsl:when>
+ <xsl:when test="$intended-level='internet' and ($title='References' or $title='Normative References') and
+ ($stat/rfced:publication-status='STANDARD' or $stat/rfced:publication-status='BEST CURRENT PRACTICE')">
+ <!-- ok -->
+ </xsl:when>
+ <xsl:when test="$intended-level!='' and ($title='References' or $title='Normative References')">
+ <xsl:text>-- intended standards level of </xsl:text>
+ <xsl:value-of select="$intended-level"/>
+ <xsl:text> incompatible with this document's standard level</xsl:text>
+ <xsl:if test="annotation//xref[@target='BCP97']">
+ <xsl:text> (...but a downref annotation referencing BCP 97 seems to be present)</xsl:text>
+ </xsl:if>
+ <xsl:text>!</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>ok</xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>&#10;</xsl:text>
+</xsl:template>
+
+<!-- check Internet Draft reference, experimental -->
+<xsl:template match="reference" mode="check-internet-draft">
+ <xsl:variable name="name" select="seriesInfo[(@name='ID' or @name='Internet-Draft') and starts-with(@value,'draft-')]/@value" />
+ <xsl:value-of select="$name" />
+ <xsl:text>: </xsl:text>
+ <xsl:variable name="base" select="substring($name,1,string-length($name)-3)"/>
+ <xsl:variable name="number" select="substring($name,string-length($name)-1)"/>
+ <xsl:variable name="stat" select="document(concat('http://tools.ietf.org/draft/',$base,'/state.xml'))" />
+
+ <!--stat: <xsl:value-of select="$stat/ietfdoc/info/rev"/>
+ number: <xsl:value-of select="$number"/>-->
+
+ <xsl:choose>
+ <xsl:when test="$stat/ietfdoc/info/rev != $number">
+ <xsl:text>Alternate version available: </xsl:text><xsl:value-of select="$stat/ietfdoc/info/rev"/>
+ <xsl:if test="$stat/ietfdoc[state/phase='Published']">
+ <xsl:text>, later published as: RFC</xsl:text><xsl:value-of select="$stat/ietfdoc/info/rfcnum"/>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="$stat/ietfdoc[state/phase='Published']">
+ <xsl:value-of select="concat('(-> RFC',$stat/ietfdoc/info/rfcnum,')')"/>
+ </xsl:when>
+ <xsl:when test="$stat/ietfdoc/state[phase='IESG' or phase='RFC-Editor']">
+ <xsl:value-of select="concat('[',$stat/ietfdoc/state/phase/@ts,' ',$stat/ietfdoc/state/phase,'] ok')"/>
+ </xsl:when>
+ <xsl:when test="$stat/ietfdoc[state/phase='ID-Exists' and info/validity='Active']">
+ <xsl:value-of select="concat('[',$stat/ietfdoc/state/phase/@ts,' ',$stat/ietfdoc/state/phase,'] ok')"/>
+ </xsl:when>
+ <xsl:when test="$stat/ietfdoc[info/validity!='Active']">
+ <xsl:value-of select="concat('[',$stat/ietfdoc/state/phase/@ts,' ',$stat/ietfdoc/state/phase,' ',$stat/ietfdoc/info/validity,'] (not active)')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>ID does not exist</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template match="reference" mode="check-internet-draft-old">
+ <xsl:variable name="name" select="seriesInfo[(@name='ID' or @name='Internet-Draft') and starts-with(@value,'draft-')]/@value" />
+ <xsl:value-of select="$name" />
+ <xsl:text>: </xsl:text>
+ <xsl:variable name="stat" select="document('ietf-id-status.xml')/*/draft[@xml:id=$name]" />
+ <xsl:choose>
+ <xsl:when test="$stat[@status='active' or @status='IESG']">
+ <xsl:value-of select="concat('[',$stat/@date,' ',$stat/@status,'] ok')"/>
+ </xsl:when>
+ <xsl:when test="$stat[@status='RFC']">
+ <xsl:value-of select="concat('[',$stat/@date,' ',$stat/@status,'] (-> RFC',$stat/@num,')')"/>
+ </xsl:when>
+ <xsl:when test="$stat[@status='expired']">
+ <xsl:value-of select="concat('[',$stat/@date,' ',$stat/@status,'] expired!')"/>
+ </xsl:when>
+ <xsl:when test="$stat">
+ <xsl:value-of select="concat('[',$stat/@date,' ',$stat/@status,'] UNKNOWN STATUS!')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="base" select="substring($name,1,string-length($name)-3)"/>
+ <xsl:variable name="stat2" select="document('ietf-id-status.xml')/*/draft[starts-with(@xml:id,$base)]" />
+ <xsl:choose>
+ <xsl:when test="$stat2">
+ <xsl:text>Alternate version available: </xsl:text><xsl:value-of select="$stat2/@xml:id"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>ID does not exist</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>&#10;</xsl:text>
+</xsl:template>
+
+<!-- check W3C reference -->
+<xsl:template match="reference" mode="check-w3c" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:doc="http://www.w3.org/2000/10/swap/pim/doc#"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:pd="http://www.w3.org/2001/02pd/rec54#">
+ <xsl:variable name="w3c" select="document('tr.rdf')"/>
+ <xsl:variable name="name" select="seriesInfo/@value" />
+ <xsl:value-of select="$name" />
+ <xsl:text>: </xsl:text>
+ <xsl:variable name="stat">
+ <xsl:for-each select="$w3c/*/*">
+ <xsl:variable name="t">
+ <xsl:call-template name="base-name">
+ <xsl:with-param name="s" select="@rdf:about"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="$t=$name">
+ <xsl:value-of select="concat(@rdf:about,' ')"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="contains(normalize-space($stat),' ')">
+ <xsl:text>ambiguous match: </xsl:text><xsl:value-of select="$stat"/>
+ </xsl:when>
+ <xsl:when test="$stat!=''">
+ <xsl:variable name="basename" select="normalize-space($stat)"/>
+ <xsl:variable name="doc" select="$w3c/*/*[@rdf:about=$basename]"/>
+ <xsl:value-of select="concat('[',local-name($doc),'] ')"/>
+ <xsl:variable name="previous" select="$w3c/*/*[pd:previousEdition/@rdf:resource=$basename]"/>
+ <xsl:choose>
+ <xsl:when test="$previous">
+ <xsl:text>obsoleted by</xsl:text>
+ <xsl:for-each select="$previous">
+ <xsl:sort select="translate(dc:date,'-','')"/>
+ <xsl:if test="position()=last()">
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="base-name">
+ <xsl:with-param name="s" select="@rdf:about"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>ok</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>document unknown</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>&#10;</xsl:text>
+</xsl:template>
+
+</xsl:transform>
739 tools/rfc2629xslt/clean-for-DTD.xslt
@@ -0,0 +1,739 @@
+<!--
+ Strip rfc2629.xslt extensions, generating XML input for MTR's xml2rfc
+
+ Copyright (c) 2006-2011, Julian Reschke (julian.reschke@greenbytes.de)
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of Julian Reschke nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0"
+ xmlns:ed="http://greenbytes.de/2002/rfcedit"
+ xmlns:grddl="http://www.w3.org/2003/g/data-view#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:x="http://purl.org/net/xml2rfc/ext"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml"
+ exclude-result-prefixes="ed grddl rdf x xhtml"
+>
+
+<!-- re-use some of the default RFC2629.xslt rules -->
+<xsl:import href="rfc2629.xslt"/>
+
+<!-- undo strip-space decls -->
+<xsl:preserve-space elements="*"/>
+
+<!-- generate DTD-valid output, override all values imported from rfc2629.xslt -->
+<xsl:output doctype-system="rfc2629.dtd" doctype-public="" method="xml" version="1.0" encoding="UTF-8" cdata-section-elements="artwork" />
+
+<!-- kick into cleanup mode -->
+<xsl:template match="/">
+ <xsl:text>&#10;</xsl:text>
+ <xsl:comment>
+ This XML document is the output of clean-for-DTD.xslt; a tool that strips
+ extensions to RFC2629(bis) from documents for processing with xml2rfc.
+</xsl:comment>
+ <xsl:apply-templates select="/" mode="cleanup"/>
+</xsl:template>
+
+<!-- rules for identity transformations -->
+
+<xsl:template match="processing-instruction()" mode="cleanup">
+ <xsl:text>&#10;</xsl:text>
+ <xsl:copy/>
+</xsl:template>
+
+<xsl:template match="comment()|@*" mode="cleanup"><xsl:copy/></xsl:template>
+
+<xsl:template match="text()" mode="cleanup"><xsl:copy/></xsl:template>
+
+<xsl:template match="/" mode="cleanup">
+ <xsl:copy><xsl:apply-templates select="node()" mode="cleanup" /></xsl:copy>
+</xsl:template>
+
+<xsl:template match="*" mode="cleanup">
+ <xsl:element name="{local-name()}">
+ <xsl:apply-templates select="node()|@*" mode="cleanup" />
+ </xsl:element>
+</xsl:template>
+
+
+<!-- remove PI extensions -->
+
+<xsl:template match="processing-instruction('rfc-ext')" mode="cleanup"/>
+<xsl:template match="processing-instruction('BEGININC')" mode="cleanup"/>
+<xsl:template match="processing-instruction('ENDINC')" mode="cleanup"/>
+
+<!-- add issues appendix -->
+
+<xsl:template match="back" mode="cleanup">
+ <back>
+ <xsl:apply-templates select="node()|@*" mode="cleanup" />
+ <xsl:if test="not(/*/@ed:suppress-issue-appendix='yes') and //ed:issue[@status='closed']">
+ <section title="Resolved issues (to be removed by RFC Editor before publication)">
+ <t>
+ Issues that were either rejected or resolved in this version of this
+ document.
+ </t>
+ <xsl:apply-templates select="//ed:issue[@status='closed']" mode="issues" />
+ </section>
+ </xsl:if>
+ <xsl:if test="not(/*/@ed:suppress-issue-appendix='yes') and //ed:issue[@status='open']">
+ <section title="Open issues (to be removed by RFC Editor prior to publication)">
+ <xsl:apply-templates select="//ed:issue[@status!='closed']" mode="issues" />
+ </section>
+ </xsl:if>
+ </back>
+</xsl:template>
+
+
+
+
+<!-- extensions -->
+
+<xsl:template match="x:abnf-char-sequence" mode="cleanup">
+ <xsl:choose>
+ <xsl:when test="substring(.,1,1) != '&quot;' or substring(.,string-length(.),1) != '&quot;'">
+ <xsl:call-template name="error">
+ <xsl:with-param name="msg" select="'contents of x:abnf-char-sequence needs to be quoted.'" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>%x</xsl:text>
+ <xsl:call-template name="to-abnf-char-sequence">
+ <xsl:with-param name="chars" select="substring(.,2,string-length(.)-2)"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="x:anchor-alias" mode="cleanup"/>
+
+<xsl:template match="x:bcp14" mode="cleanup">
+ <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="x:assign-section-number" mode="cleanup"/>
+<xsl:template match="x:link" mode="cleanup"/>
+<xsl:template match="x:source" mode="cleanup"/>
+<xsl:template match="x:feedback" mode="cleanup"/>
+
+<xsl:template match="x:parse-xml" mode="cleanup">
+ <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="x:prose" mode="cleanup">
+ <xsl:variable name="text" select="."/>
+ <xsl:comment>Converted from rfc2629.xslt x:prose extension</xsl:comment>
+ <xsl:choose>
+ <xsl:when test="contains($text,' ')">
+ <seriesInfo name="{substring-before($text,' ')}" value="{substring-after($text,' ')}"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <seriesInfo name="" value="{$text}"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="x:ref" mode="cleanup">
+ <xsl:variable name="val" select="."/>
+ <xsl:variable name="target" select="//*[@anchor and (@anchor=$val or x:anchor-alias/@value=$val)][not(ancestor::ed:del)]"/>
+ <xsl:choose>
+ <xsl:when test="$target">
+ <xsl:if test="count($target)!=1">
+ <xsl:message terminate="yes">FATAL: multiple x:ref targets found for <xsl:value-of select="$val"/>.</xsl:message>
+ </xsl:if>
+ <xsl:variable name="current" select="."/>
+ <xsl:for-each select="$target">
+ <!-- make it the context -->
+ <xsl:choose>
+ <xsl:when test="self::preamble">
+ <!-- it's not an element we can link to -->
+ <xsl:call-template name="warning">
+ <xsl:with-param name="inline" select="'no'"/>
+ <xsl:with-param name="msg">couldn't create the link as <xsl:value-of select="name()"/> does not support the anchor attribute.</xsl:with-param>
+ </xsl:call-template>
+ <xsl:value-of select="$current"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xref target="{$target/@anchor}" format="none"><xsl:value-of select="$current"/></xref>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="warning">
+ <xsl:with-param name="inline" select="'no'"/>
+ <xsl:with-param name="msg">internal link target for '<xsl:value-of select="."/>' does not exist.</xsl:with-param>
+ </xsl:call-template>
+ <xsl:value-of select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="x:blockquote" mode="cleanup">
+ <t><list>
+ <xsl:apply-templates mode="cleanup" />
+ </list></t>
+</xsl:template>
+
+<xsl:template match="x:h" mode="cleanup">
+ <xsl:apply-templates mode="cleanup" />
+</xsl:template>
+
+<xsl:template match="x:highlight" mode="cleanup">
+ <xsl:apply-templates mode="cleanup" />
+</xsl:template>
+
+<xsl:template match="x:lt" mode="cleanup">
+ <t>
+ <xsl:apply-templates select="@hangText|@anchor" mode="cleanup"/>
+ <xsl:for-each select="t">
+ <xsl:apply-templates mode="cleanup"/>
+ <xsl:if test="position()!=last()">
+ <vspace blankLines="1"/>
+ </xsl:if>
+ </xsl:for-each>
+ </t>
+</xsl:template>
+
+<xsl:template match="x:note" mode="cleanup">
+ <t>
+ <list>
+ <xsl:apply-templates mode="cleanup"/>
+ </list>
+ </t>
+</xsl:template>
+
+<xsl:template match="x:q" mode="cleanup">
+ <xsl:text>"</xsl:text>
+ <xsl:apply-templates mode="cleanup"/>
+ <xsl:text>"</xsl:text>
+</xsl:template>
+
+<xsl:template match="x:dfn" mode="cleanup">
+ <!-- help xml2rfc to keep dfn and following text on the same page -->
+ <xsl:if test="not(preceding-sibling::x:dfn) and count(following-sibling::list)=1">
+ <xsl:processing-instruction name="rfc">needLines="4"</xsl:processing-instruction>
+ </xsl:if>
+ <xsl:apply-templates mode="cleanup"/>
+</xsl:template>
+
+<xsl:template match="x:sup" mode="cleanup">
+ <xsl:text>^</xsl:text>
+ <xsl:apply-templates mode="cleanup" />
+</xsl:template>
+
+<xsl:template match="x:span" mode="cleanup">
+ <xsl:apply-templates mode="cleanup" />
+</xsl:template>
+<xsl:template match="x:span/@anchor" mode="cleanup"/>
+
+<xsl:template match="author/@anchor" mode="cleanup"/>
+<xsl:template match="x:include-author" mode="cleanup">
+ <t>
+ <xsl:value-of select="/*/front/author[@anchor=current()/@target]"/>
+ </t>
+ <t>
+ (see Authors Section)
+ </t>
+</xsl:template>
+
+<!-- extended reference formatting -->
+
+<xsl:template match="xref[(@x:fmt or @x:sec or @x:rel) and not(node())]" mode="cleanup">
+ <xsl:call-template name="insert-iref-for-xref"/>
+ <xsl:variable name="node" select="$src//*[@anchor=current()/@target]" />
+
+ <xsl:variable name="sec">
+ <xsl:choose>
+ <xsl:when test="starts-with(@x:rel,'#') and not(@x:sec) and $node/x:source/@href">
+ <xsl:variable name="extdoc" select="document($node/x:source/@href)"/>
+ <xsl:for-each select="$extdoc//*[@anchor=substring-after(current()/@x:rel,'#')]">
+ <xsl:call-template name="get-section-number"/>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@x:sec"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="secterm">
+ <xsl:choose>
+ <!-- starts with letter? -->
+ <xsl:when test="translate(substring($sec,1,1),$ucase,'')=''">Appendix</xsl:when>
+ <xsl:otherwise>Section</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="fmt">
+ <xsl:choose>
+ <xsl:when test="@x:fmt!=''"><xsl:value-of select="@x:fmt"/></xsl:when>
+ <xsl:when test="ancestor::artwork">,</xsl:when>
+ <xsl:otherwise>of</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="$fmt=','">
+ <xref>
+ <xsl:apply-templates select="@target|@format|@pageno|text()|*" mode="cleanup"/>
+ </xref>
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="$secterm"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$sec"/>
+ </xsl:when>
+ <xsl:when test="$fmt='sec'">
+ <xsl:value-of select="$secterm"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$sec"/>
+ </xsl:when>
+ <xsl:when test="$fmt='number'">
+ <xsl:value-of select="$sec"/>
+ </xsl:when>
+ <xsl:when test="$fmt='()'">
+ <xref>
+ <xsl:apply-templates select="@target|@format|@pageno|text()|*" mode="cleanup"/>
+ </xref>
+ <xsl:text> (</xsl:text>
+ <xsl:value-of select="$secterm"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$sec"/>
+ <xsl:text>)</xsl:text>
+ </xsl:when>
+ <xsl:when test="$fmt='of'">
+ <xsl:value-of select="$secterm"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$sec"/>
+ <xsl:text> of </xsl:text>
+ <xref>
+ <xsl:apply-templates select="@target|@format|@pageno|text()|*" mode="cleanup"/>
+ </xref>
+ </xsl:when>
+ <xsl:when test="$fmt='anchor'">
+ <xsl:variable name="val">
+ <xsl:call-template name="referencename">
+ <xsl:with-param name="node" select="$node" />
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- remove brackets -->
+ <xsl:value-of select="substring($val,2,string-length($val)-2)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy>
+ <xsl:apply-templates select="node()" mode="cleanup"/>
+ </xsl:copy>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="xref[(@x:fmt or @x:sec or @x:rel) and node()]" mode="cleanup">
+ <xsl:call-template name="insert-iref-for-xref"/>
+ <xsl:choose>
+ <xsl:when test="@x:fmt='none'">
+ <xsl:apply-templates mode="cleanup"/>
+ </xsl:when>
+ <xsl:when test="not(@x:fmt)">
+ <xref>
+ <xsl:copy-of select="@target|@format"/>
+ <xsl:apply-templates mode="cleanup"/>
+ </xref>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>Unsupported x:fmt attribute.</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="xref[node() and (@target=//preamble/@anchor or @target=//spanx/@anchor)]" mode="cleanup">
+ <!-- remove the link -->
+ <xsl:apply-templates select="node()" mode="cleanup"/>
+</xsl:template>
+
+<xsl:template match="xref[not(node()) and (@target=//preamble/@anchor or @target=//spanx/@anchor)]" mode="cleanup">
+ <!-- fatal -->
+ <xsl:message terminate="yes">Broken xref <xsl:value-of select="@target"/> due to target being filtered out.</xsl:message>
+</xsl:template>
+
+<xsl:template match="xref" mode="cleanup" priority="0">
+ <xsl:call-template name="insert-iref-for-xref"/>
+ <xref>
+ <xsl:copy-of select="@target|@format"/>
+ <xsl:apply-templates mode="cleanup"/>
+ </xref>
+</xsl:template>
+
+<xsl:template name="insert-iref-for-xref">
+ <xsl:if test="$xml2rfc-ext-include-references-in-index='yesxxx' and $xml2rfc-ext-include-index='yes'">
+ <xsl:if test="@target=/rfc/back//reference/@anchor">
+ <iref item="{@target}"/>
+ <xsl:if test="@x:sec">
+ <xsl:choose>
+ <xsl:when test="translate(substring(@x:sec,1,1),$ucase,'')=''">
+ <iref item="{@target}" subitem="Appendix {@x:sec}"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <iref item="{@target}" subitem="Section {@x:sec}"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+</xsl:template>
+
+<!-- drop index gen extension -->
+<xsl:template match="iref" mode="cleanup">
+ <xsl:if test="$xml2rfc-ext-include-index='yes'">
+ <iref>
+ <xsl:apply-templates select="@*|node()" mode="cleanup"/>
+ </iref>
+ </xsl:if>
+</xsl:template>
+
+
+<!-- issue tracking extensions -->
+
+<xsl:template match="@xml:lang" mode="cleanup"/>
+<xsl:template match="@xml:lang" />
+
+<xsl:template match="ed:*" mode="cleanup"/>
+<xsl:template match="ed:*" />
+
+<xsl:template match="@ed:*" mode="cleanup"/>
+<xsl:template match="@ed:*" />
+
+<xsl:template match="ed:annotation" mode="cleanup" />
+
+<xsl:template match="ed:replace" mode="cleanup">
+ <xsl:apply-templates mode="cleanup" />
+</xsl:template>
+
+<xsl:template match="ed:replace">
+ <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="ed:ins" mode="cleanup">
+ <xsl:apply-templates mode="cleanup"/>
+</xsl:template>
+
+<xsl:template match="ed:ins">
+ <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="ed:issue" mode="issues">
+ <section title="{@name}">
+ <xsl:variable name="sec">
+ <xsl:call-template name="get-section-number"/>
+ </xsl:variable>
+
+ <xsl:if test="$sec!=''">
+ <t>
+ In Section <xsl:value-of select="$sec"/>:
+ </t>
+ </xsl:if>
+
+ <t>
+ Type: <xsl:value-of select="@type" />
+ </t>
+ <xsl:if test="@href">
+ <t>
+ <!-- temp. removed because of xml2rfc's handling of erefs when producing TXT-->
+ <!--<eref target="{@href}" /> -->
+ <xsl:text>&lt;</xsl:text>
+ <xsl:value-of select="@href"/>
+ <xsl:text>></xsl:text>
+ <xsl:if test="@alternate-href">
+ <xsl:text>, &lt;</xsl:text>
+ <xsl:value-of select="@alternate-href"/>
+ <xsl:text>></xsl:text>
+ </xsl:if>
+ </t>
+ </xsl:if>
+ <xsl:for-each select="ed:item">
+ <t>
+ <xsl:if test="@entered-by or @date">
+ <xsl:choose>
+ <xsl:when test="not(@entered-by)">
+ <xsl:value-of select="concat('(',@date,') ')" />
+ </xsl:when>
+ <xsl:when test="not(@date)">
+ <xsl:value-of select="concat(@entered-by,': ')" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat(@entered-by,' (',@date,'): ')" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="not(xhtml:p)">
+ <xsl:apply-templates select="node()" mode="issues"/>
+ </xsl:if>
+ </t>
+ <xsl:if test="xhtml:p|xhtml:pre">
+ <xsl:for-each select="node()">
+ <xsl:choose>
+ <xsl:when test="self::xhtml:p">
+ <t>
+ <xsl:apply-templates select="node()" mode="issues"/>
+ </t>
+ </xsl:when>
+ <xsl:when test="self::xhtml:pre">
+ <figure>
+ <artwork><xsl:apply-templates select="node()" mode="issues"/></artwork>
+ </figure>
+ </xsl:when>
+ <xsl:otherwise>
+ <t>
+ <xsl:apply-templates select="." mode="issues"/>
+ </t>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:if test="ed:resolution">
+ <t>
+ <xsl:text>Resolution</xsl:text>
+ <xsl:if test="ed:resolution/@datetime"> (<xsl:value-of select="ed:resolution/@datetime"/>)</xsl:if>
+ <xsl:text>: </xsl:text>
+ <xsl:value-of select="ed:resolution" />
+ </t>
+ </xsl:if>
+ </section>
+</xsl:template>
+
+<xsl:template match="ed:issueref" mode="cleanup">
+ <xsl:apply-templates mode="cleanup"/>
+</xsl:template>
+
+<xsl:template match="*" mode="issues">
+ <xsl:apply-templates mode="issues"/>
+</xsl:template>
+
+<xsl:template match="xhtml:q" mode="issues">
+ <list><t>
+ <xsl:text>"</xsl:text>
+ <xsl:apply-templates mode="issues"/>
+ <xsl:text>"</xsl:text>
+ <xsl:if test="@cite">
+ <xsl:text> -- </xsl:text>
+ <eref target="{@cite}"><xsl:value-of select="@cite"/></eref>
+ </xsl:if>
+ </t></list>
+</xsl:template>
+
+<xsl:template match="xhtml:br" mode="issues">
+ <vspace/>
+</xsl:template>
+
+<xsl:template match="xhtml:del" mode="issues">
+ <xsl:text>&lt;del></xsl:text>
+ <xsl:apply-templates mode="issues"/>
+ <xsl:text>&lt;/del></xsl:text>
+</xsl:template>
+
+<xsl:template match="xhtml:em" mode="issues">
+ <spanx style="emph">
+ <xsl:apply-templates mode="issues"/>
+ </spanx>
+</xsl:template>
+
+<xsl:template match="xhtml:ins" mode="issues">
+ <xsl:text>&lt;ins></xsl:text>
+ <xsl:apply-templates mode="issues"/>
+ <xsl:text>&lt;/ins></xsl:text>
+</xsl:template>
+
+<xsl:template match="xhtml:tt" mode="issues">
+ <xsl:apply-templates mode="issues"/>
+</xsl:template>
+
+<xsl:template match="ed:eref" mode="issues">
+ <xsl:text>&lt;</xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text>&gt;</xsl:text>
+</xsl:template>
+
+<xsl:template match="ed:issueref" mode="issues">
+ <xsl:apply-templates mode="issues"/>
+</xsl:template>
+
+<xsl:template match="text()" mode="issues">
+ <xsl:value-of select="." />
+</xsl:template>
+
+
+
+<!-- markup inside artwork element -->
+
+<xsl:template match="figure[.//artwork//iref | .//artwork//xref]" mode="cleanup">
+ <!-- move up iref elements -->
+ <xsl:for-each select=".//artwork//xref">
+ <xsl:if test="not(ancestor::ed:del)">
+ <xsl:call-template name="insert-iref-for-xref"/>
+ </xsl:if>
+ </xsl:for-each>
+ <figure>
+ <xsl:apply-templates select="@*" mode="cleanup" />
+ <xsl:apply-templates select=".//artwork//iref" mode="cleanup"/>
+ <xsl:apply-templates select="iref|preamble|artwork|postamble|ed:replace|ed:ins|ed:del" mode="cleanup" />
+ </figure>
+</xsl:template>
+
+<xsl:template name="insert-begin-code"/>
+<xsl:template name="insert-end-code"/>
+<xsl:template match="@x:isCodeComponent" mode="cleanup"/>
+
+<xsl:template match="artwork" mode="cleanup">
+ <xsl:variable name="content2"><xsl:apply-templates select="."/></xsl:variable>
+ <xsl:variable name="content" select="translate($content2,'&#160;&#x2500;&#x2502;&#x2508;&#x250c;&#x2510;&#x2514;&#x2518;&#x251c;&#x2524;',' -|+++++++')"/>
+ <artwork>
+ <xsl:apply-templates select="@*" mode="cleanup" />
+ <xsl:if test="@x:isCodeComponent='yes'">
+ <xsl:if test="starts-with(.,'&#10;')">
+ <xsl:text>&#10;</xsl:text>
+ </xsl:if>
+ <xsl:value-of select="@x:indent-with"/>
+ <xsl:text>&lt;CODE BEGINS&gt;&#10;</xsl:text>
+ </xsl:if>
+ <xsl:if test="starts-with(.,'&#10;')">
+ <xsl:text>&#10;</xsl:text>
+ <xsl:value-of select="@x:indent-with"/>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="@x:indent-with!=''">
+ <xsl:call-template name="indent">
+ <xsl:with-param name="content" select="$content"/>
+ <xsl:with-param name="with" select="@x:indent-with"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$content"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="@x:isCodeComponent='yes'">&#10;&lt;CODE ENDS&gt;&#10;</xsl:if>
+ </artwork>
+</xsl:template>
+
+<xsl:template match="@x:indent-with" mode="cleanup"/>
+
+<xsl:template name="indent">
+ <xsl:param name="content"/>
+ <xsl:param name="with"/>
+
+ <xsl:value-of select="substring($content,1,1)"/>
+ <xsl:if test="substring($content,1,1)='&#10;'">
+ <xsl:value-of select="$with"/>
+ </xsl:if>
+
+ <xsl:choose>
+ <xsl:when test="$content=''" />
+ <xsl:otherwise>
+ <xsl:call-template name="indent">
+ <xsl:with-param name="content" select="substring($content,2)"/>
+ <xsl:with-param name="with" select="$with"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+
+</xsl:template>
+
+<!-- email repetitions -->
+<xsl:template match="email" mode="cleanup">
+ <!-- combine in a single element -->
+ <xsl:if test="not(preceding-sibling::email)">
+ <email>
+ <xsl:for-each select="../email">
+ <xsl:value-of select="."/>
+ <xsl:if test="position()!=last()">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ </xsl:for-each>
+ </email>
+ </xsl:if>
+</xsl:template>
+
+<!-- markup inside cref -->
+<xsl:template match="cref//eref" mode="cleanup">
+ <xsl:text>&lt;</xsl:text>
+ <xsl:value-of select="@target"/>
+ <xsl:text>&gt;</xsl:text>
+</xsl:template>
+
+<xsl:template match="cref//xref" mode="cleanup" priority="9">
+ <xsl:variable name="text">
+ <xsl:apply-templates select="."/>
+ </xsl:variable>
+ <xsl:value-of select="$text"/>
+</xsl:template>
+
+<!-- annotations -->
+<xsl:template match="@x:annotation" mode="cleanup">
+ <xsl:comment>
+ <xsl:value-of select="."/>
+ </xsl:comment>
+ <xsl:call-template name="warning">
+ <xsl:with-param name="inline" select="'no'"/>
+ <xsl:with-param name="msg">Dropping annotation on <xsl:value-of select="local-name(..)"/> element.</xsl:with-param>
+ </xsl:call-template>
+</xsl:template>
+
+<!-- artwork extensions -->
+<xsl:template match="artwork/@x:extraction-note" mode="cleanup"/>
+
+<!-- list formatting -->
+<xsl:template match="list/@x:indent" mode="cleanup"/>
+
+<!-- referencing extensions -->
+<xsl:template match="iref/@x:for-anchor" mode="cleanup"/>
+
+<!-- table styles -->
+<xsl:template match="texttable/@style" mode="cleanup"/>
+
+<!-- section numbering -->
+<xsl:template match="section/@x:fixed-section-number" mode="cleanup"/>
+
+<!-- GRRDL info stripped -->
+<xsl:template match="@grddl:transformation" mode="cleanup"/>
+
+<!-- maturity level stripped -->
+<xsl:template match="@x:maturity-level" mode="cleanup"/>
+
+<!-- normativity stripped -->
+<xsl:template match="@x:nrm" mode="cleanup"/>
+
+<!-- title extensions -->
+<xsl:template match="title/@x:quotes" mode="cleanup"/>
+
+<!-- RDF info stripped -->
+<xsl:template match="rdf:*" mode="cleanup"/>
+
+<!-- cases where xml2rfc does not allow anchors -->
+<xsl:template match="c/@anchor" mode="cleanup"/>
+<xsl:template match="preamble/@anchor" mode="cleanup"/>
+<xsl:template match="spanx/@anchor" mode="cleanup"/>
+
+</xsl:transform>
94 tools/rfc2629xslt/extract-artwork.xslt
@@ -0,0 +1,94 @@
+<!--
+ Extract named artwork elements.
+
+ Copyright (c) 2006-2009, Julian Reschke (julian.reschke@greenbytes.de)
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of Julian Reschke nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:x="http://purl.org/net/xml2rfc/ext"
+ version="1.0"
+>
+
+<xsl:import href="clean-for-DTD.xslt"/>
+
+<xsl:output method="text" encoding="UTF-8"/>
+
+<xsl:param name="name" />
+<xsl:param name="except-name" />
+<xsl:param name="type" />
+
+<xsl:template match="/" priority="9">
+
+ <xsl:choose>
+ <xsl:when test="$name!=''">
+ <xsl:variable name="artwork" select="//artwork[@name=$name]"/>
+
+ <xsl:choose>
+ <xsl:when test="$artwork">
+ <xsl:for-each select="$artwork">
+ <xsl:value-of select="@x:extraction-note"/>
+ <xsl:apply-templates select="." mode="cleanup"/>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>Artwork element named '<xsl:value-of select="$name"/>' not found.</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$type!=''">
+ <xsl:variable name="artwork" select="//artwork[@type=$type]"/>
+
+ <xsl:choose>
+ <xsl:when test="$artwork">
+ <xsl:for-each select="$artwork">
+ <xsl:choose>
+ <xsl:when test="$except-name!='' and @name=$except-name">
+ <!-- do not emit this one -->
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@x:extraction-note"/>
+ <xsl:apply-templates select="." mode="cleanup"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>Artwork element typed '<xsl:value-of select="$type"/>' not found.</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>Please specify either name or type parameter.</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+
+
+</xsl:template>
+
+
+</xsl:transform>
56 tools/rfc2629xslt/extractExtRefs.xslt
@@ -0,0 +1,56 @@
+<!--
+ Extract external (image) references from RFC2629 XML format
+
+ Copyright (c) 2010, Julian Reschke (julian.reschke@greenbytes.de)
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of Julian Reschke nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns="http://www.daisy.org/z3986/2005/ncx/"
+ version="1.0"
+>
+
+<xsl:output method="text" encoding="UTF-8"/>
+
+<xsl:template match="/">
+ <xsl:for-each select="//artwork/@src">
+ <xsl:choose>
+ <xsl:when test="contains(.,'/')">
+ <xsl:message>ERROR: referenced file <xsl:value-of select="."/> must be in the same folder as the base file.</xsl:message>
+ </xsl:when>
+ <xsl:when test="not(../@type)">
+ <xsl:message>ERROR: referenced file <xsl:value-of select="."/> missing media type attribute.</xsl:message>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="."/>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+</xsl:template>
+
+</xsl:transform>
44 tools/rfc2629xslt/extractInlineCss.xslt
@@ -0,0 +1,44 @@
+<!--
+ Extract inline CSS from XHTML
+
+ Copyright (c) 2010, Julian Reschke (julian.reschke@greenbytes.de)
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of Julian Reschke nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml"
+ version="1.0">
+
+<xsl:import href="rfc2629.xslt"/>
+
+<xsl:output encoding="UTF-8" method="text" indent="no"/>
+
+<xsl:template match="/">
+ <xsl:call-template name="insertCss"/>
+</xsl:template>
+
+</xsl:transform>
423 tools/rfc2629xslt/gen-reference-graph.xslt
@@ -0,0 +1,423 @@
+<!--
+ Gen reference graph (requires local copy of "rfc-index.xml",
+ available from <ftp://ftp.isi.edu/in-notes/rfc-index.xml> and
+ "tr.rdf", available from <http://www.w3.org/2002/01/tr-automation/tr.rdf>)
+
+ Copyright (c) 2006-2007, Julian Reschke (julian.reschke@greenbytes.de)
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of Julian Reschke nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:doc="http://www.w3.org/2000/10/swap/pim/doc#"
+ xmlns:ed="http://greenbytes.de/2002/rfcedit"
+ xmlns:exslt="http://exslt.org/common"
+ xmlns:msxsl="urn:schemas-microsoft-com:xslt"
+ xmlns:rfced="http://www.rfc-editor.org/rfc-index"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:tr="http://www.w3.org/2001/02pd/rec54#"
+>
+
+<xsl:output method="text" encoding="UTF-8"/>
+
+<!-- character translation tables -->
+<xsl:variable name="lcase" select="'abcdefghijklmnopqrstuvwxyz'" />
+<xsl:variable name="ucase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
+
+<!-- define exslt:node-set for msxml -->
+<msxsl:script language="JScript" implements-prefix="exslt">
+ this['node-set'] = function (x) {
+ return x;
+ }
+</msxsl:script>
+
+<xsl:template match="/">
+ <xsl:text>digraph </xsl:text>
+ <xsl:value-of select="translate(/rfc/@docName,'-.','__')" />
+ <xsl:text> { &#10;</xsl:text>
+ <xsl:text> rankdir=LR;</xsl:text>
+
+ <xsl:variable name="out">
+ <xsl:for-each select="//references">
+ <xsl:variable name="title">
+ <xsl:choose>
+ <xsl:when test="@title">
+ <xsl:value-of select="@title"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>References</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:for-each select=".//reference[not(ancestor::ed:del)]">
+ <xsl:sort select="@anchor"/>
+ <xsl:choose>
+ <xsl:when test="seriesInfo/@name='RFC'">
+ <xsl:apply-templates select="." mode="check-rfc"/>
+ </xsl:when>
+ <xsl:when test="seriesInfo/@name='Internet-Draft'">
+ <!-- Nothing to do -->
+ </xsl:when>
+ <xsl:when test="seriesInfo/@name='W3C'">
+ <xsl:call-template name="check-w3c">
+ <xsl:with-param name="serinfo" select="seriesInfo[@name='W3C']"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="seriesInfo/@name='W3C NOTE'">
+ <xsl:message>Warning: seriesInfo/@name for W3C specs should be 'W3C', found: 'W3C NOTE'.</xsl:message>
+ <xsl:call-template name="check-w3c">
+ <xsl:with-param name="serinfo" select="seriesInfo[@name='W3C NOTE']"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="seriesInfo/@name='W3C REC'">
+ <xsl:message>Warning: seriesInfo/@name for W3C specs should be 'W3C', found: 'W3C REC'.</xsl:message>
+ <xsl:call-template name="check-w3c">
+ <xsl:with-param name="serinfo" select="seriesInfo[@name='W3C REC']"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="seriesInfo/@name='World Wide Web Consortium FirstEdition'">
+ <xsl:message>Warning: seriesInfo/@name for W3C specs should be 'W3C', found: 'World Wide Web Consortium FirstEdition'.</xsl:message>
+ <xsl:call-template name="check-w3c">
+ <xsl:with-param name="serinfo" select="seriesInfo[@name='World Wide Web Consortium FirstEdition']"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="seriesInfo/@name='World Wide Web Consortium Recommendation'">
+ <xsl:message>Warning: seriesInfo/@name for W3C specs should be 'W3C', found: 'World Wide Web Consortium Recommendation'.</xsl:message>
+ <xsl:call-template name="check-w3c">
+ <xsl:with-param name="serinfo" select="seriesInfo[@name='World Wide Web Consortium Recommendation']"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="seriesInfo/@name">
+ <xsl:message>Warning: unknown seriesInfo/@name: '<xsl:value-of select="seriesInfo/@name"/>'. </xsl:message>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <xsl:for-each select="exslt:node-set($out)/definition">
+ <xsl:if test="not(@id = preceding-sibling::definition/@id)">
+ <xsl:value-of select="."/>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:for-each select="exslt:node-set($out)/relation">
+ <xsl:if test="not(. = preceding-sibling::relation)">
+ <xsl:value-of select="."/>
+ </xsl:if>
+ </xsl:for-each>
+
+ <xsl:text>}&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template name="write-rfc-node-def">
+ <xsl:param name="node"/>
+ <xsl:variable name="boxstyle">
+ <xsl:choose>
+ <xsl:when test="$node/rfced:current-status='BEST CURRENT PRACTICE'">
+ <xsl:text>[style = filled, fillcolor = black, fontcolor=white, shape=box]</xsl:text>
+ </xsl:when>
+ <xsl:when test="$node/rfced:current-status='INFORMATIONAL'">
+ <xsl:text>[style = filled, fillcolor = blue]</xsl:text>
+ </xsl:when>
+ <xsl:when test="$node/rfced:current-status='EXPERIMENTAL'">
+ <xsl:text>[style = filled, fillcolor = cyan]</xsl:text>
+ </xsl:when>
+ <xsl:when test="$node/rfced:current-status='PROPOSED STANDARD'">
+ <xsl:text>[style = "filled,rounded", fillcolor = yellow, shape=box]</xsl:text>
+ </xsl:when>
+ <xsl:when test="$node/rfced:current-status='DRAFT STANDARD'">
+ <xsl:text>[style = "filled,rounded", fillcolor = orange, shape=box]</xsl:text>
+ </xsl:when>
+ <xsl:when test="$node/rfced:current-status='STANDARD'">
+ <xsl:text>[style = "filled,rounded", fillcolor = green, shape=box]</xsl:text>
+ </xsl:when>
+ <xsl:otherwise></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <definition id="{$node/rfced:doc-id}">
+ <xsl:text> "</xsl:text>
+ <xsl:value-of select="$node/rfced:doc-id"/>
+ <xsl:text>" [URL = "</xsl:text>
+ <xsl:value-of select="concat('http://tools.ietf.org/html/',translate($node/rfced:doc-id,$ucase,$lcase))"/>
+ <xsl:text>"][tooltip = "</xsl:text>
+ <xsl:value-of select="$node/rfced:title"/>
+ <xsl:text>"]</xsl:text>
+ <xsl:value-of select="$boxstyle"/>
+ <xsl:text>;&#10;</xsl:text>
+ </definition>
+</xsl:template>
+
+<xsl:template name="write-w3c-node-def">
+ <xsl:param name="node"/>
+ <xsl:param name="doc-id"/>
+ <xsl:variable name="boxstyle">
+ <xsl:choose>
+ <xsl:when test="local-name($node) = 'NOTE'">
+ <xsl:text>[style = filled, fillcolor = blue]</xsl:text>
+ </xsl:when>
+ <xsl:when test="local-name($node) = 'FirstEdition'">
+ <xsl:text>[style = "filled,rounded", fillcolor = green, shape=box]</xsl:text>
+ </xsl:when>
+ <xsl:when test="local-name($node) = 'PER'">
+ <xsl:text>[style = "filled,rounded", fillcolor = yellow, shape=box]</xsl:text>
+ </xsl:when>
+ <xsl:when test="local-name($node) = 'REC'">
+ <xsl:text>[style = "filled,rounded", fillcolor = green, shape=box]</xsl:text>
+ </xsl:when>
+ <xsl:otherwise></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <definition id="{$doc-id}">
+ <xsl:text> "</xsl:text>
+ <xsl:value-of select="$doc-id"/>
+ <xsl:text>" [URL = "</xsl:text>
+ <xsl:value-of select="$node/@rdf:about"/>
+ <xsl:text>"][tooltip = "</xsl:text>
+ <xsl:value-of select="$node/dc:title"/>
+ <xsl:text>"]</xsl:text>
+ <xsl:value-of select="$boxstyle"/>
+ <xsl:text>;&#10;</xsl:text>
+ </definition>
+</xsl:template>
+
+<!-- check an RFC Index entry -->
+<xsl:template name="check-rfc-index-entry">
+ <xsl:param name="src-id"/>
+ <xsl:param name="doc-id"/>
+ <xsl:param name="title"/>
+
+ <xsl:variable name="stat" select="document('rfc-index.xml')/*/rfced:rfc-entry[rfced:doc-id=$doc-id]" />
+
+ <xsl:if test="$stat/rfced:doc-id">
+ <xsl:call-template name="write-rfc-node-def">
+ <xsl:with-param name="node" select="$stat"/>
+ </xsl:call-template>
+ </xsl:if>
+
+ <xsl:if test="$src-id">
+ <relation>
+ <xsl:text> "</xsl:text>
+ <xsl:value-of select="$src-id"/>
+ <xsl:text>" -> "</xsl:text>
+ <xsl:value-of select="$doc-id"/>
+ <xsl:choose>
+ <xsl:when test="$title='References' or $title='Normative References'">
+ <xsl:text>" [style = solid, color = red][tooltip = "normatively references"];&#10;</xsl:text>
+ </xsl:when>
+ <xsl:when test="$title!=''">
+ <xsl:text>" [style = solid][tooltip = "informatively references"];&#10;</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>" [style = solid][tooltip = "references&q