📄 rfc2629.txt
字号:
<t>This is list item. <vspace blankLines="1" /> This is part of the same list item, although when displayed, it appears as a separate physical paragraph.</t> </list> An XML application producing a text version of the document should exercise care when encountering a value for "blankLines" that causes a pagebreak -- in particular, if a "vspace" element causes a pagebreak, then no further blank lines should be inserted. This allows authors to "force" a pagebreak by using an arbitrarily large value, e.g., "blankLines='100'". Finally, note that the "vspace" element is always empty -- it never contains any text.Rose Informational [Page 16]RFC 2629 Writing I-Ds and RFCs using XML June 19992.4 Back matter Finally, the "back" element is used for references and appendices: ... </middle> <back> <references> <reference ...> <reference ...> </references> <section ...> <section ...> </back> </rfc> The "back" element consists of an optional "references" element, and, one or more optional "section" elements. The "back" element itself is optional, if your document doesn't have any references or appendices, you don't have to include it.2.4.1 The references Element The "references" element contains the document's bibliography. It contains one or more "reference" elements. Each "reference" element contains a "front" element and one or more optional "seriesInfo" elements. We've already discussed the "front" element back in Section 2.2. The "seriesInfo" element has two attributes, "name" and "value" that identify the document series and series entry, respectively.Rose Informational [Page 17]RFC 2629 Writing I-Ds and RFCs using XML June 1999 The "reference" element has an optional "anchor" attribute that is used for cross-referencing with the "xref" element (Section 2.3.1.4), e.g., <reference anchor="refs.RFC2200"> <front> <title>Internet Official Protocol Standards</title> <author initials="J." surname="Postel" fullname="Jon Postel"> <organization abbrev="ISI"> USC/Information Sciences Institute </organization> </author> <date month="June" year="1997" /> </front> <seriesInfo name="RFC" value="2200" /> <seriesInfo name="STD" value="1" /> </reference> The "reference" element also has an optional "target" attribute that is used for external references (c.f., Section 2.3.1.5). The XML application, if producing an HTML version of the document will use the "target" attribute accordingly; however, if the "name" attribute of the "seriesInfo" element has the value "RFC", then the XML application should automatically provide an appropriate default for the "target" attribute (e.g., "http://example.com/rfcs/rfc2200.txt").2.4.2 Appendices To include appendices after the bibliography, simply add more "section" elements. (For an example, look at the example at the beginning of Section 2.4.)2.4.3 Copyright Status The copyright status for the document is not included in the document's markup -- this is automatically inserted by an XML application that produces either a text or HTML version of the document.Rose Informational [Page 18]RFC 2629 Writing I-Ds and RFCs using XML June 19993. Processing the XML Source File This section concerns itself with applications that operate on an XML source file. A lot of XML tools are available, as are many lists of XML resources, e.g., Cafe con Leche [5]. There are two kinds of XML tools: validating and non-validating. Both check that the source file conforms to the rules given in Section 2.1. However, in addition to making sure that the source file is well-formed, a validating tool also reads the DTD referenced by the source file to make sure that they match. There are a number of both validating and non-validating tools available.3.1 Editing There are several XML editors available. Ideally, you want an editor that validates. This has two advantages: o the editor provides guidance in fleshing-out the document structure; and, o the editor validates that the source file matches the rules in the DTD. There are two major modes in Emacs that support XML: tdtd [6] and psgml [7]. The latter mode allows you to validate the source file (by calling an external program). If you visit the source file in Emacs and the major mode isn't "SGML" or "XML", then usually all it takes is adding these lines to your ".emacs" file: (setq auto-mode-alist (cons (cons "\\.xml$" 'sgml-mode) auto-mode-alist)) and then restarting Emacs. If this doesn't work, try one of the sources above. The author uses both sgml-mode in Emacs, and a commercial validating editor, Clip! version 1.5 [8], when editing source files.3.1.1 Checking If your editor doesn't validate, then you should run a program to validate the source file. The author uses the AlphaWorks XML parser [9] for this purpose. It requires that your system have a Java virtual machine. In addition to Java, there are validating parsers written in C, Perl, Python, and Tcl.Rose Informational [Page 19]RFC 2629 Writing I-Ds and RFCs using XML June 19993.2 Converting to Text Format The author has written the xml2rfc tool [10], which reads the source file and produces both a text and HTML version of the document. (This memo was produced using the xml2rfc tool.) Note that xml2rfc isn't a validating tool, so it's a good idea to use either a validating editor or run a stand-alone validating parser prior to using the tool.3.3 Converting to HTML Format The XML Style Language (XSL) is used to describe transformations from the source file into some other structured file. So, ideally you should use an XSL-capable formatter to convert an XML source file to HTML. However, as of this writing XSL is still in considerable flux. (Hence, no reference was included in this memo, as by the time you read this section, the reference would be outdated.) So, in the interim, the author uses the xml2rfc tool for this purpose, even though this tool doesn't provide much flexibility in its HTML layout.3.4 Viewing Browsers that support either XSL or Cascading Style Sheets (CSS) are able to view the source file directly. At present, the author doesn't use any of these browsers, instead converting source files to either text or HTML.3.5 Searching As with text editors, any text-oriented search tool (e.g., grep) can be used on the source file. However, there are search tools available that understand structured source. The author uses sgrep version 1.9 [11] for this purpose, e.g. sgrep -g xml 'ELEMENTS("title") not in ELEMENTS("back")' \ writing-rfcs.xml which extracts the title element from the source file.Rose Informational [Page 20]RFC 2629 Writing I-Ds and RFCs using XML June 19994. Security Considerations This memo raises no security issues; however, according to [2], your document should contain a section near the end that discusses the security considerations of the protocol or procedures that are the main topic of your document, e.g., <middle> ... <section title="Security Considerations"> <t>This memo raises no security issues; however, according to <xref target="refs.RFC2223" />, your document should contain a section near the end that discusses the security considerations of the protocol or procedures that are the main topic of your document.</t> </section> </middle>Rose Informational [Page 21]RFC 2629 Writing I-Ds and RFCs using XML June 1999References [1] World Wide Web Consortium, "Extensible Markup Language (XML) 1.0", W3C XML, February 1998. [2] Postel, J. and J. Reynolds, "Instructions to RFC Authors", RFC 2223, October 1997. [3] Bradner, S., "The Internet Standards Process -- Revision 3", BCP 9, RFC 2026, October 1996. [4] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform Resource Identifiers (URI): Generic Syntax", RFC 2396, August 1998. [5] http://metalab.unc.edu/xml/ [6] http://www.mulberrytech.com/tdtd/ [7] http://www.inria.fr/koala/plh/sxml.html [8] http://www.t2000-usa.com/ [9] http://www.alphaworks.ibm.com/formula/xml/ [10] http://memory.palace.org/authoring/ [11] http://www.cs.helsinki.fi/~jjaakkol/sgrep.htmlAuthor's Address Marshall T. Rose Invisible Worlds, Inc. 660 York Street San Francisco, CA 94110 US Phone: +1 415 695 3975 EMail: mrose@not.invisible.net URI: http://invisible.net/Rose Informational [Page 22]RFC 2629 Writing I-Ds and RFCs using XML June 1999Appendix A. The rfc Element The "<rfc>" tag at the beginning of the file, with only an "ipr" attribute (Section 2.2.7.1), produces an Internet-Draft. However, when other attributes are added to this tag by the RFC editor, an RFC is produced, e.g., <rfc number="2200" obsoletes="2000, 1920, 1880, 1800, ..." category="std" seriesNo="1"> At a minimum, the "number" attribute should be present. The other attributes are: o "obsoletes", having a comma-separated list of RFC numbers, that the document obsoletes; o "updates", having a comma-separated list of RFC numbers, that the document updates; o "category", having one of these values: 1. "std", for a Standards-Track document; 2. "bcp", "for a Best Current Practices document; 3. "exp", for an Experimental Protocol document; 4. "historic", for a historic document; or, 5. "info", the default, for an Informational document. o "seriesNo", having the corresponding number in the STD (std), BCP (bcp), or FYI (info) series. Finally, a special entity, "&rfc.number;", is available. Authors preparing an RFC should use this entity whenever they want to reference the number of the RFC within the document itself. In printed versions of the document, the appropriate substitution (or "XXXX") will occur.Rose Informational [Page 23]RFC 2629 Writing I-Ds and RFCs using XML June 1999Appendix B. The RFC DTD <!-- DTD for the RFC document series, draft of 99-01-30 --> <!-- Contents DTD data types
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -