RFC2629 through XSLT J. Reschke greenbytes November 2012 Transforming RFC2629-formatted XML through XSLT Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 2. Supported RFC2629 elements . . . . . . . . . . . . . . . . . . 5 2.1. Extension elements . . . . . . . . . . . . . . . . . . . 5 3. Processing Instructions . . . . . . . . . . . . . . . . . . . 6 3.1. Supported xml2rfc-compatible PIs . . . . . . . . . . . . 7 3.2. Unsupported xml2rfc-compatible PIs . . . . . . . . . . . 8 3.3. Extension PIs . . . . . . . . . . . . . . . . . . . . . . 9 4. Anchors . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 5. Supported XSLT engines . . . . . . . . . . . . . . . . . . . . 15 5.1. Standalone Engines . . . . . . . . . . . . . . . . . . . 15 5.2. In-Browser Engines . . . . . . . . . . . . . . . . . . . 15 6. Transforming to HTML . . . . . . . . . . . . . . . . . . . . . 17 6.1. HTML compliance . . . . . . . . . . . . . . . . . . . . . 17 6.2. Standard HTML LINK elements . . . . . . . . . . . . . . . 17 6.3. Standard HTML metadata . . . . . . . . . . . . . . . . . 18 6.4. Dublin Core (RFC2731) metadata . . . . . . . . . . . . . 18 6.5. Experimental hCard support . . . . . . . . . . . . . . . 18 7. Transforming to XHTML . . . . . . . . . . . . . . . . . . . . 19 8. Transforming to CHM (Microsoft Compiled Help) . . . . . . . . 20 9. Transforming to PDF . . . . . . . . . . . . . . . . . . . . . 21 9.1. Via XSL-FO . . . . . . . . . . . . . . . . . . . . . . . 21 9.1.1. Extension feature matrix . . . . . . . . . . . . . . . 21 9.1.2. Example: producing output for Apache FOP . . . . . . . 22 9.2. Via X(HTML) . . . . . . . . . . . . . . . . . . . . . . . 22 10. Transforming to ePub . . . . . . . . . . . . . . . . . . . . . 23 11. Generic Extensions . . . . . . . . . . . . . . . . . . . . . . 24 11.1. element . . . . . . . . . . . . . . 24 11.2. element . . . . . . . . . . . . . . . . . 24 11.3. element . . . . . . . . . . . . . . . . . . . . . 24 11.4. element . . . . . . . . . . . . . . . . . . . . . . 25 11.5. element . . . . . . . . . . . . . . . . . . . . . . 25 11.6.
element . . . . . . . . . . . . . . . . . . 25 11.7. element . . . . . . . . . . . . . . . . . . 25 11.8. element . . . . . . . . . . . . . . . . . . . . . . 26 11.9. element . . . . . . . . . . . . . . . . . . . . . . 26 11.10. element . . . . . . . . . . . . . . . . . . . 26 11.11. element . . . . . . . . . . . . . . . . . . . . . . . 26 Reschke [Page 1] Documentation RFC2629 through XSLT November 2012 11.12. element . . . . . . . . . . . . . . . . . . . 26 11.13. element . . . . . . . . . . . . . . . . . . . 26 11.14. element . . . . . . . . . . . . . . . . . . . . . 27 11.15. element . . . . . . . . . . . . . . . . . . . . . . 27 11.16. element . . . . . . . . . . . . . . . . . . . . . 27 11.17. element . . . . . . . . . . . . . . . . . . . 27 11.18. element . . . . . . . . . . . . . . . . . . . . . 28 11.19. element . . . . . . . . . . . . . . . . . . . . . . . 28 11.20. element . . . . . . . . . . . . . . . . . . . . . . 28 11.21. element . . . . . . . . . . . . . . . . . . . . 28 11.22. element . . . . . . . . . . . . . . . . . . . . . . 29 11.23. Extensions to Xml2rfc element . . . . . . . . . 29 11.24. Extensions to Xml2rfc element . . . . . . . . . . 29 11.25. Extensions to Xml2rfc element . . . . . . . . . . 29 11.26. Extensions to Xml2rfc element . . . . . . . . . . . 30 11.27. Extensions to Xml2rfc
element . . . . . . . . . 30 11.28. Extensions to Xml2rfc element . . . . . . . . . . 30 12. Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . 32 12.1. Checking References . . . . . . . . . . . . . . . . . . . 32 12.2. Generating Graphs from References . . . . . . . . . . . . 34 12.3. Producing reference entries for books . . . . . . . . . . 34 12.4. Down-converting to RFC2629bis DTD . . . . . . . . . . . . 35 12.5. Extracting artwork . . . . . . . . . . . . . . . . . . . 36 12.6. GRRDL . . . . . . . . . . . . . . . . . . . . . . . . . . 36 13. Informative References . . . . . . . . . . . . . . . . . . . . 37 Appendix A. RELAX NG Compact Schema . . . . . . . . . . . . . . . 39 Appendix B. Implementation Notes . . . . . . . . . . . . . . . . 49 B.1. Recognized type attributes for element . . . . 49 Appendix C. Examples . . . . . . . . . . . . . . . . . . . . . . 50 C.1. Using the 'Internal Subset' . . . . . . . . . . . . . . . 50 C.2. Customization . . . . . . . . . . . . . . . . . . . . . . 50 Appendix D. Producing the IETF 'Boilerplate' . . . . . . . . . . 52 D.1. The /rfc/@ipr Attribute . . . . . . . . . . . . . . . . . 52 D.1.1. Current Values: '*trust200902' . . . . . . . . . . . . 53 D.1.2. Historic Values . . . . . . . . . . . . . . . . . . . 54 D.2. The /rfc/@category Attribute . . . . . . . . . . . . . . 55 D.3. The /rfc/@submissionType Attribute . . . . . . . . . . . 55 D.4. The /rfc/@consensus Attribute . . . . . . . . . . . . . . 56 D.5. The /rfc/@number Attribute . . . . . . . . . . . . . . . 56 D.6. The /rfc/@docName Attribute . . . . . . . . . . . . . . . 57 D.7. The /rfc/@obsoletes Attribute . . . . . . . . . . . . . . 57 D.8. The /rfc/@updates Attribute . . . . . . . . . . . . . . . 57 Appendix E. License . . . . . . . . . . . . . . . . . . . . . . . 58 Appendix F. Change Logs . . . . . . . . . . . . . . . . . . . . . 59 F.1. Package . . . . . . . . . . . . . . . . . . . . . . . . . 59 F.2. amazon-asin.xslt . . . . . . . . . . . . . . . . . . . . 60 F.3. check-references.xslt . . . . . . . . . . . . . . . . . . 60 F.4. gen-reference-graph.xslt . . . . . . . . . . . . . . . . 61 Reschke [Page 2] Documentation RFC2629 through XSLT November 2012 F.5. rfc2629.xslt . . . . . . . . . . . . . . . . . . . . . . 61 F.6. rfc2629toFO.xslt . . . . . . . . . . . . . . . . . . . . 72 F.7. xsl11toAn.xslt . . . . . . . . . . . . . . . . . . . . . 74 F.8. xsl11toFop.xslt . . . . . . . . . . . . . . . . . . . . . 74 F.9. xsl11toXep.xslt . . . . . . . . . . . . . . . . . . . . . 74 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 83 Reschke [Page 3] Documentation RFC2629 through XSLT November 2012 1. Introduction This document describes a set of XSLT transformations that can be used to transform RFC2629-compliant XML (see [RFC2629]) to various output formats, such as HTML and PDF. The main topics are o compliance to the xml2rfc XML element set (Section 2), o support for xml2rfc processing instructions (Section 3), o the names of anchor elements generated in HTML and PDF output (Section 4), o various XSLT engines that can be used (Section 5), o outputting HTML (Section 6) and XHTML (Section 7), o outputting CHM (Compiled Microsoft Help, Section 8), o outputting PDF (Section 9), o outputting ePub (Section 10), o extensions to the xml2rfc vocabulary (Section 11). o various utilities (Section 12). The full distribution is available at . Reschke [Page 4] Documentation RFC2629 through XSLT November 2012 2. Supported RFC2629 elements "rfc2629.xslt" supports both all RFC2629 grammar elements and the extensions implemented in xml2rfc 1.36. 2.1. Extension elements "rfc2629.xslt" supports two kind of extension elements, using different XML namespaces. The first set contains (hopefully) generally useful extensions, see Section 11. The second set is used for change and issue tracking and currently is not documented here. Please email the author in case you're interested in using these extensions. Reschke [Page 5] Documentation RFC2629 through XSLT November 2012 3. Processing Instructions All PIs can be set as XSLT parameter as well, overriding any value that is found in the source file to be transformed. Using processing instructions: Using XSLT parameters (Saxon): java -cp saxon.jar com.icl.saxon.StyleSheet source.xml rfc2629.xslt \ xml2rfc-toc=yes xml2rfc-ext-support-rfc2731=no > result.html Using XSLT parameters (xsltproc): xsltproc --param xml2rfc-toc '"yes"' \ --param xml2rfc-ext-support-rfc2731 '"no"' \ rfc2629.xslt source.xml > result.html (note the required quoting of string parameters) Reschke [Page 6] Documentation RFC2629 through XSLT November 2012 3.1. Supported xml2rfc-compatible PIs +------+--------------+------------------+------------+-------------+ | PI | PI | XSLT parameter | default | comment | | targ | pseudo-attri | name | | | | et | bute | | | | +------+--------------+------------------+------------+-------------+ | rfc | background | xml2rfc-backgrou | (not set) | | | | | nd | | | | | | | | | | rfc | compact | xml2rfc-compact | "no" | only | | | | | | applies to | | | | | | HTML output | | | | | | method when | | | | | | printing | | | | | | | | rfc | comments | xml2rfc-comments | (not set) | | | | | | | | | rfc | editing | xml2rfc-editing | "no" | | | | | | | | | rfc | footer | xml2rfc-footer | (not set) | | | | | | | | | rfc | header | xml2rfc-header | (not set) | | | | | | | | | rfc | inline | xml2rfc-inline | (not set) | | | | | | | | | rfc | iprnotified | xml2rfc-iprnotif | "no" | | | | | ied | | | | | | | | | | rfc | linkmailto | xml2rfc-linkmail | "yes" | | | | | to | | | | | | | | | | rfc | private | xml2rfc-private | (not set) | | | | | | | | | rfc | refparent | xml2rfc-private | "Reference | Title for | | | | | s" | References | | | | | | sections | | | | | | when | | | | | | automatical | | | | | | ly inserted | | | | | | | | rfc | rfcedstyle | xml2rfc-rfcedsty | (not set) | (limited | | | | le | | support) | | | | | | | | rfc | sortrefs | xml2rfc-sortrefs | "no" | | | | | | | | Reschke [Page 7] Documentation RFC2629 through XSLT November 2012 | rfc | symrefs | xml2rfc-symrefs | "yes" | The default | | | | | | has changed | | | | | | from "no" | | | | | | to "yes" as | | | | | | of June 6, | | | | | | 2007 and | | | | | | xml2rfc | | | | | | 1.33pre4. | | | | | | | | rfc | toc | xml2rfc-toc | "no" | | | | | | | | | rfc | tocdepth | xml2rfc-tocdepth | 99 | | | | | | | | | rfc | topblock | xml2rfc-topblock | "yes" | | +------+--------------+------------------+------------+-------------+ 3.2. Unsupported xml2rfc-compatible PIs +--------+------------------+---------------------------------------+ | PI | PI | comment | | target | pseudo-attribute | | +--------+------------------+---------------------------------------+ | rfc | include | incompatible with XML/XSLT processing | | | | model, please use external entities | | | | instead | | | | | | rfc | needLines | | | | | | | rfc | slides | | | | | | | rfc | strict | | | | | | | rfc | subcompact | | | | | | | rfc | tocindent | (defaults to "yes") | | | | | | rfc | tocompact | | +--------+------------------+---------------------------------------+ Reschke [Page 8] Documentation RFC2629 through XSLT November 2012 3.3. Extension PIs +------+-----------------+-----------------------+------+-----------+ | PI | PI | XSLT parameter name | defa | descripti | | targ | pseudo-attribut | | ult | on | | et | e | | | | +------+-----------------+-----------------------+------+-----------+ | rfc- | allow-markup-in | xml2rfc-allow-markup- | "no" | Enables | | ext | -artwork | in-artwork | | support | | | | | | for | | | | | | specific | | | | | | elements | | | | | | inside | | | | | | abstract | | | | | | elements | | | | | | (using | | | | | | this | | | | | | extension | | | | | | makes the | | | | | | document | | | | | | incompati | | | | | | ble to | | | | | | the | | | | | | RFC2629bi | | | | | | s DTD; | | | | | | see | | | | | | descripti | | | | | | on of | | | | | | conversio | | | | | | n XSLT in | | | | | | Section 1 | | | | | | 2.4). | | | | | | | Reschke [Page 9] Documentation RFC2629 through XSLT November 2012 | rfc- | authors-section | xml2rfc-ext-authors-s | | When | | ext | | ection | | "end", | | | | | | place the | | | | | | authors | | | | | | section | | | | | | at the | | | | | | end (just | | | | | | before | | | | | | the | | | | | | copyright | | | | | | statement | | | | | | s). This | | | | | | seems to | | | | | | be the | | | | | | preferred | | | | | | order in | | | | | | the | | | | | | newest | | | | | | RFCs. | | | | | | | | rfc- | duplex | xml2rfc-ext-duplex | no | When set | | ext | | | | to "yes", | | | | | | format | | | | | | the PDF | | | | | | output | | | | | | for | | | | | | doublesid | | | | | | ed | | | | | | printing. | | | | | | | | rfc- | include-index | xml2rfc-ext-include-i | "yes | When set | | ext | | ndex | " | to "no", | | | | | | no index | | | | | | will be | | | | | | generated | | | | | | . | | | | | | | | rfc- | include-referen | xml2rfc-ext-include-r | | When set | | ext | ces-in-index | eferences-in-index | | to "yes", | | | | | | index | | | | | | entries | | | | | | are | | | | | | generated | | | | | | for all | | | | | | reference | | | | | | s. | | | | | | | Reschke [Page 10] Documentation RFC2629 through XSLT November 2012 | rfc- | justification | xml2rfc-ext-justifica | "nev | "never": | | ext | | tion | er" | never | | | | | | emit | | | | | | justified | | | | | | text, | | | | | | "always": | | | | | | always | | | | | | emit | | | | | | justified | | | | | | text, | | | | | | "print": | | | | | | only emit | | | | | | justified | | | | | | text for | | | | | | print | | | | | | media. | | | | | | | | rfc- | parse-xml-in-ar | xml2rfc-parse-xml-in- | "no" | May be | | ext | twork | artwork | | used to | | | | | | enable | | | | | | parsing | | | | | | of XML | | | | | | content | | | | | | in | | | | | | figures | | | | | | (MSXML | | | | | | only). | | | | | | | | rfc- | support-rfc2731 | xml2rfc-ext-support-r | "yes | Decides | | ext | | fc2731 | " | whether | | | | | | the HTML | | | | | | transform | | | | | | ation | | | | | | should | | | | | | generate | | | | | | META tags | | | | | | according | | | | | | Section 6 | | | | | | .4. | | | | | | | Reschke [Page 11] Documentation RFC2629 through XSLT November 2012 | rfc- | sec-no-trailing | xml2rfc-ext-sec-no-tr | | When set | | ext | -dots | ailing-dots | | to "yes", | | | | | | add | | | | | | trailing | | | | | | dots to | | | | | | section | | | | | | numbers. | | | | | | This | | | | | | seems to | | | | | | be the | | | | | | preferred | | | | | | format in | | | | | | the | | | | | | newest | | | | | | RFCs. | +------+-----------------+-----------------------+------+-----------+ Reschke [Page 12] Documentation RFC2629 through XSLT November 2012 4. Anchors The transformation automatically generates anchors that are supposed to be stable and predictable and that can be used to identify specific parts of the document. Anchors are generated both in HTML and XSL-FO content (but the latter will only be used for PDF output when the XSL-FO engine supports producing PDF anchors). Reschke [Page 13] Documentation RFC2629 through XSLT November 2012 The following anchors get auto-generated: +-----------------------+---------------------------------------+ | Anchor name | Description | +-----------------------+---------------------------------------+ | rfc.abstract | Abstract | | | | | rfc.authors | Authors section | | | | | rfc.copyright | Copyright section | | | | | rfc.copyrightnotice | Copyright notice | | | | | rfc.figure._n_ | Figures (titled) | | | | | rfc.figure.u._n_ | Figures (untitled) | | | | | rfc.index | Index | | | | | rfc.ipr | Intellectual Property | | | | | rfc.iref._n_ | Internal references | | | | | rfc.note._n_ | Notes (from front section) | | | | | rfc.references | References | | | | | rfc.references._n_ | Additional references | | | | | rfc.section._n_ | Section _n_ | | | | | rfc.section._n_.p._m_ | Section _n_, paragraph _m_ | | | | | rfc.status | Status of memo | | | | | rfc.table._n_ | Tables (titled) | | | | | rfc.table.u._n_ | Tables (untitled) | | | | | rfc.toc | Table of contents | | | | | rfc.xref._name_._n_ | References to reference _n_ to _name_ | +-----------------------+---------------------------------------+ Reschke [Page 14] Documentation RFC2629 through XSLT November 2012 5. Supported XSLT engines The transformation requires a non-standard extension function (see exsl:node-set [1]) which is however widely available. XSLT processors that do not support this extension (or a functional equivalent, such as msxsl:node-set) currently are not supported. Input documents do not always specify the date completely. In this case, the transformation attempts to let the XSLT engine to compute the system date, using either scripting in Microsoft's XSLT engine, or the exsl:date-time [2] extension function. 5.1. Standalone Engines The following XSLT engines are believed to work well: o Windows: MSXML3 and MSXML4 (; command line processor "msxsl" is available from Microsoft Download Center [3]) o Java: Saxon () o Java: Xalan () o C/C++: xsltproc (libxslt) (, make sure that you have a current version) 5.2. In-Browser Engines The following browsers seem to work fine: o Internet Explorer 5.5 (Windows version, if MSXML3 is installed) o Internet Explorer 6 and newer o Firefox 3.0 and newer * Be aware that XSLT execution can be suppressed using NoScript [4] * Firefox does not load external DTDs nor external entities, see Mozilla Bug 22942 [5], thus entities like   need to be declared in the internal subset (Appendix C.1) * There seems to be a new problem in Firefox 4 where it occasionally does the initial rendering with the wrong width (people who can reproduce this problem please comment on Reschke [Page 15] Documentation RFC2629 through XSLT November 2012 . * Date computation is available in Firefox starting with Firefox 6 (see ) o Safari 3 (starting with version 3.0.4) * Date computation not available (see ) o Google Chrome * Date computation not available (see ) o Opera (starting with version 10) * Date computation not available The following browsers are known not to work properly: o Firefox 1.*/2.*: (missing extension function - see change request at Mozilla BugZilla 193678 [6]) o Opera 9.21: execution fails, potentially to a somewhat complex XPath expression (reported to Opera as bug 245725). o Opera 9.5 and 9.6: transformation appears to work, but CSS isn't getting applied (reported to Opera as bug 337388 on 2008-06-12). o Safari 2.* supports client-side XSLT as of MacOS X 10.4, but misses required extension functions. A problem with stylesheets producing non-ASCII output (such as NBSP characters) has been fixed as of OSX 10.4.4. Both problems have been reported through Apple's bug tracking system, see and . Reschke [Page 16] Documentation RFC2629 through XSLT November 2012 6. Transforming to HTML Transformation to HTML can be done inside the browser if it supports XSLT. To enable this, add the following processing instruction to the start of the source file: (and ensure that "rfc2629.xslt" is present). 6.1. HTML compliance The transformation result is supposed to conform to the HTML 4.01 strict DTD [HTML]. This can be checked using the W3C's online validator at . 6.2. Standard HTML LINK elements LINK elements exist since HTML 2.0. They can be used to embed content-independant links inside the document. Unfortunately, only few user agents support this element. Firefox users may want to check the Link Widgets [7] extension. The following LINK elements are produced: +-----------+-------------------------------------------------------+ | LINK type | description | +-----------+-------------------------------------------------------+ | alternate | for RFCs, a link to the authorative ASCII version on | | | the IETF web site | | | | | appendic | pointer to all top-level appendics | | | | | author | pointer to "authors" section | | | | | chapter | pointer to all top-level sections | | | | | contents | pointer to table of contents | | | | | copyright | pointer to copyright statement | | | | | index | pointer to index | +-----------+-------------------------------------------------------+ The figure below shows how Mozilla Firefox 1.0 displays the Site Navigation Bar for rfc2396.xml. Reschke [Page 17] Documentation RFC2629 through XSLT November 2012 6.3. Standard HTML metadata The following standard HTML META elements are produced: +-----------+-------------------------------------------------+ | META name | description | +-----------+-------------------------------------------------+ | generator | from XSLT engine version and stylesheet version | | | | | keywords | from keyword elements in front section | +-----------+-------------------------------------------------+ 6.4. Dublin Core (RFC2731) metadata Unless turned off using the "rfc-ext support-rfc2731" processing instruction, the transformation will generate metadata according to [RFC2731] and [DC-HTML]. The following DCMI properties are produced: +-------------------------+-----------------------------------------+ | META name | description | +-------------------------+-----------------------------------------+ | DC.Creator | from author information in front | | | section | | | | | DC.Date.Issued | from date information in front section | | | | | DC.Description.Abstract | from abstract | | | | | DC.Identifier | document URN [RFC2648] from "docName" | | | attribute | | | | | DC.isPartOf | RFC ISSN (for RFCs) | | | | | DC.Relation.Replaces | from "obsoletes" attribute | +-------------------------+-----------------------------------------+ 6.5. Experimental hCard support The generated author information is formatted in hCard [8] format. Reschke [Page 18] Documentation RFC2629 through XSLT November 2012 7. Transforming to XHTML Transforming to XHTML requires slightly different XSLT output options and is implemented by the derived transformation script "rfc2629toXHTML.xslt". Note: Microsoft Internet Explorer does _not_ support XHTML. Therefore it usually makes more sense to generate plain old HTML. Reschke [Page 19] Documentation RFC2629 through XSLT November 2012 8. Transforming to CHM (Microsoft Compiled Help) To generate a CHM file using Microsoft's HTML Help Compiler (hhc), three files are required in addition to the HTML file. 1. hhc - table of contents file (HTML) 2. hhk - index file (HTML) 3. hhp - project file (plain text) The three files are generated with three specific transformations, each requiring the additional XSLT parameter "basename" to specify the filename prefix. Example: saxon rfc2616.xml rfc2629toHhp.xslt basename=rfc2616 > rfc2616.hhp saxon rfc2616.xml rfc2629toHhc.xslt basename=rfc2616 > rfc2616.hhc saxon rfc2616.xml rfc2629toHhk.xslt basename=rfc2616 > rfc2616.hhk hhc rfc2616.hhp Reschke [Page 20] Documentation RFC2629 through XSLT November 2012 9. Transforming to PDF 9.1. Via XSL-FO Transformation to XSL-FO [XSL-FO] format is available through "rfc2629toFO.xslt" (which includes "rfc2629.xslt", so keep both in the same folder). Compared to HTML user agents, XSL-FO engines unfortunately either come as open source (for instance, Apache FOP) or feature-complete (for instance, AntennaHouse XSL Formatter), but not both at the same time. As Apache FOP needs special workarounds (index generation), and some popular extensions aren't standardized yet, the translation produces a generic output (hopefully) conforming to [XSL-FO]. Specific backends ("xsl11toFop.xslt", "xsl11toXep.xslt", "xsl11toAn.xslt") then provide post-processing for the individual processors. Note: the output is currently targeted at Apache FOP 1.0. 9.1.1. Extension feature matrix +------------+-------------+------------+-------------+-------------+ | | PDF anchors | PDF | PDF | Index | | | | bookmarks | document | cleanup | | | | | information | | +------------+-------------+------------+-------------+-------------+ | XSL 1.1 | no, but can | yes | no, but | yes | | WD [9] | be | | uses XEP | | | | auto-genera | | output | | | | ted from | | extensions | | | | "id" | | | | | | attributes | | | | | | | | | | | Antenna | no | yes [11] | yes [11] | yes [11] | | House XSL | | (from XSL | (from XEP | (just page | | formatter | | 1.1 | document | duplicate | | [10] | | bookmarks) | info) | elimination | | | | | | , from XSL | | | | | | 1.1 page | | | | | | index) | | | | | | | | Apache | yes | yes (from | yes | no | | FOP [12] | | XSL 1.1 | | | | | | bookmarks) | | | | | | | | | Reschke [Page 21] Documentation RFC2629 through XSLT November 2012 | RenderX | no | yes [14] | yes [14] | yes [14] | | XEP [13] | | (from XSL | | (from XSL | | | | 1.1 | | 1.1 page | | | | bookmarks) | | index) | +------------+-------------+------------+-------------+-------------+ 9.1.2. Example: producing output for Apache FOP Example: saxon rfc2616.xml rfc2629toFo.xslt > tmp.fo saxon tmp.fo xsl11toFop.xslt > rfc2629.fo 9.2. Via X(HTML) PDF output can also be produced directly from (X)HTML. One simple approach is to rely on the browser's printing function, and to use a printer driver that produces PDF. Depending on the brower's CSS capabilities, the output will behave properly with respect to table breaks etc. An alternative is PrinceXML (see ), which can produce PDF directly from (X)HTML input, based on the CSS printing information. For instance, PDF output with text justification turned on can be produced with: saxon input.xml rfc2629toXHTML.xslt xml2rfc-ext-justification=print \ > output.xhtml prince output.xhtml output.pdf Reschke [Page 22] Documentation RFC2629 through XSLT November 2012 10. Transforming to ePub Experimental transformation to ePub format is available through a set of stylesheets, and the Unix Shell script "mkepub.sh" (which requires that "zip" and either "saxon" or "xsltproc" are installed). For instance, an epub version of rfc2616.xml can be generated like this: mkepub.sh rfc2616.xml Reschke [Page 23] Documentation RFC2629 through XSLT November 2012 11. Generic Extensions This section documents extensions implemented in "rfc2629.xslt", using the extension namespace "http://purl.org/net/xml2rfc/ext". 11.1. element Converts the contained quoted string into a hex-encoded character sequence, for use in case-sensitive ABNF productions. For instance, ""HTTP"" gets converted to "%x48.54.54.50". 11.2. element Using its "value" attribute, this element allows the definition of an internal link target alias for the enclosing element. This alias can then be used with the element for intra-document references. Note that the anchor alias is not subject to the naming constraints that apply to anchor elements (which are XML names). 11.3. element This element marks the content as being one of the normative keywords defined in [RFC2119]. Reschke [Page 24] Documentation RFC2629 through XSLT November 2012 The DOCTYPE definition below allows using these keywords using XML entity expansion: such as in "...server &MUST; accept...". MAY"> MUST"> MUST NOT"> OPTIONAL"> RECOMMENDED"> REQUIRED"> SHALL"> SHALL NOT"> SHOULD"> SHOULD NOT">]> 11.4. element Marking up a string as indicates that it represents the bottom line of a box drawing, replacing the "+" and "-" characters accordingly. 11.5. element Marking up a string as indicates that it represents a center line of a box drawing, replacing the "|" character accordingly. 11.6.
element This element is like the "blockquote" element in [HTML] (note this is a block-level element!). It should contain one or more child elements. 11.7. element Can be used to include boilerplate (status, copyright, ...) into the front or back section.
elements within appear as unnumbered sections in the output. Reschke [Page 25] Documentation RFC2629 through XSLT November 2012 _This element currently can not be "down-translated" for use in xml2rfc!_ 11.8. element Marking up a string as indicates that it represents the top line of a box drawing, replacing the "+" and "-" characters accordingly. 11.9. element This element is like the "dfn" element in [HTML]. 11.10. element This elements allows declaring a feedback link for document reviewers. The template string takes the form of a URI template, such as: where "docname" is substituted by the document name, "section" is substituted by section title (number and name), and "ref" is substituted by a URI pointing to the section being referenced. 11.11. element This element is like the "h" element in [XHTML2]. 11.12. element Used to highlight text passages, currently only allowed in . Note: this is stripped when generating input for xml2rfc, so please use with care. 11.13. element This element can be used to insert the length of another formatted section (in decimal). Example: computing the Content-Length header value ... Content-Length: 123456789 Reschke [Page 26] Documentation RFC2629 through XSLT November 2012 The lenght computation counts line ends as two characters (CRLF). Note that indentation characters in artwork _will_ be counted. The "indented" attribute allows to specify the amount of indentation to be substracted from the computed length. 11.14. element This element can be added as a top-level child element below to indicate additional link information. It's currently used only when generating HTML output, in which case an HTML element with identical attributes gets generated. Example: generating HTML link element If the attribute "basename" is present, it is used to compute the target href based on the output format being generated (this is handy for "next"/"prev" links in a series of documents. In this case, the href attribute is not required. For instance: