| XML2RFC Test Cases | J. F. Reschke |
| greenbytes | |
| June 2026 |
default ¶
compact="yes" ¶
compact="yes" subcompact="yes" ¶
compact="yes" subcompact="no" ¶
compact="no" subcompact="yes" ¶
compact="no" subcompact="no" ¶
compact="no" subcompact="yes", empty entries ¶
A numbered list: ¶
An ordered list using letters: ¶
Example for numbered list with user-defined-format: ¶
Another list: ¶
Same with character-based numbering: ¶
A few requirements: ¶
More requirements: ¶
A few rules: ¶
No style attribute:¶
Simple list item.
This one has two paragraphs. This is the first one.
This one has two paragraphs. This is the second one.
Another simple list item.
Numbers:¶
Symbols:¶
Letters:¶
Empty:¶
regular dl¶
dl/spacing=normal¶
dl/spacing=compact¶
regular ul¶
ul/spacing=normal¶
ul/spacing=compact¶
This is default.¶
This is emph(asized).¶
This is strong.¶
This is verb(atim).¶
Here is a carriage return inside a spanx element.¶
The list of valid keywords are:
| keyword | default | meaning | not aligned |
|---|---|---|---|
| strict | no | try to enforce the ID-nits conventions and DTD validity | a |
| iprnotified | no | include boilerplate from Section 10.4(d) of [RFC2026] | bb bb |
| compact | no | when producing a txt/nroff file, try to conserve vertical whitespace | ccc ccc ccc |
| subcompact | compact | if compact is "yes", then setting this to "no" will make things a little less compact | dddd dddd dddd dddd |
| needLines | n/a | an integer hint indicating how many contiguous lines are needed at this point in the output | eeeee eeeee eeeee eeeee eeeee |
| here come empty cells |
Remember, that as with everything else in XML, keywords and values are case-sensitive.
The table below should appear with no borders.
| C1 | C2 |
|---|---|
| 11 | 12 |
| 21 | 22 |
The table below should appear with borders just around the headers.
| C1 | C2 |
|---|---|
| 11 | 12 |
| 21 | 22 |
So, putting it all together, we have, e.g.,
| ttcol #1 | ttcol #2 |
|---|---|
| c #1 | c #2 |
| c #3 | c #4 |
| c #5 | c #6 |
which is a very simple example.
The table below should appear with no titles.
| 11 | 12 |
| 21 | 22 |
The table below should appear with column titles (one being non-empty).
| FOO | |
|---|---|
| 11 | 12 |
| 21 | 22 |
The table above shows a table with no borders.¶
No anchor, no title
| Anchor | Title |
|---|---|
| - | - |
Anchor (not being referenced), no title
| Anchor | Title |
|---|---|
| yes | - |
No anchor, with title
| Anchor | Title |
|---|---|
| - | "title" |
Both anchor and title
| Anchor | Title |
|---|---|
| yes | "title" |
anchor, suppress-title, and in use
| Anchor | Title |
|---|---|
| yes | - |
| title |
|---|
| 1 |
| 2 |
| title |
|---|
| left |
|---|
| 1 |
| center |
|---|
| 1 |
| right |
|---|
| 1 |
| default |
|---|
| 1 |
The figure above has the title "another figure".¶
Para...¶
Para...¶
Para...¶
Para...¶
spacing paragraph¶
spacing paragraph¶
spacing paragraph¶
spacing paragraph¶
preamble
postamble
preamble
postamble
preamble
postamble
preamble
postamble
Both figure and artwork having @src:¶
Preamble...
figure/align=right, artwork/@align=center:¶
figure/align=right, artwork/@align not specified:¶
Inclusion of SVG:¶
Marking up Code Components according to the Legal Provisions Relating to IETF Documents:¶
Using @x:is-code-component¶
Using @markers¶
Using @markers and @name¶
Single \¶
NOTE: '\' line wrapping per RFC 8792
012345678901234567890123456789012345678901234567890123456789\
01234567890123456789
or:¶
NOTE: '\' line wrapping per RFC 8792
012345678901234567890123456789012345678901234567890123456789\
01234567890123456789
Double \¶
NOTE: '\\' line wrapping per RFC 8792
012345678901234567890123456789012345678901234567890123456789\
\01234567890123456789
or (error case)¶
Check how @anchors propagate in the output.¶
No @anchor:¶
@anchor on <figure>:¶
@anchor on <artwork>:¶
@anchor both:¶
@anchor both:¶
no @anchor:¶
@anchor on <artwork>:¶
This section contains test cases for <xref/>, testing 9 different types of targets. Each target is tested for all possible values of the @format attribute, and for <xref/> elements with and without content. These tests were contributed by Erik Wilde. ¶
<xref target="section-anchor"/>: Section 5.11 ¶
<xref target="section-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT (Section 5.11) ¶
<xref format="title" target="section-anchor"/>: Test Targets ¶
<xref format="title" target="section-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT (Test Targets) ¶
<xref format="none" target="section-anchor"/>: ¶
<xref format="none" target="section-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="default" target="section-anchor"/>: Section 5.11 ¶
<xref format="default" target="section-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT (Section 5.11) ¶
<xref target="t-anchor"/>: Paragraph 2 ¶
<xref target="t-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="counter" target="t-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="title" target="t-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="none" target="t-anchor"/>: ¶
<xref format="none" target="t-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="default" target="t-anchor"/>: Paragraph 2 ¶
<xref format="default" target="t-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref target="list-t-anchor-empty"/>: Paragraph 1 ¶
<xref target="list-t-anchor-empty">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="counter" target="list-t-anchor-empty">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="title" target="list-t-anchor-empty"/>: list-t-anchor-empty ¶
<xref format="title" target="list-t-anchor-empty">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="none" target="list-t-anchor-empty"/>: ¶
<xref format="none" target="list-t-anchor-empty">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="default" target="list-t-anchor-empty"/>: Paragraph 1 ¶
<xref format="default" target="list-t-anchor-empty">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref target="list-t-anchor-numbers"/>: Paragraph 1 ¶
<xref target="list-t-anchor-numbers">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="counter" target="list-t-anchor-numbers">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="title" target="list-t-anchor-numbers"/>: list-t-anchor-numbers ¶
<xref format="title" target="list-t-anchor-numbers">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="none" target="list-t-anchor-numbers"/>: ¶
<xref format="none" target="list-t-anchor-numbers">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="default" target="list-t-anchor-numbers"/>: Paragraph 1 ¶
<xref format="default" target="list-t-anchor-numbers">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref target="list-t-anchor-letters"/>: Paragraph 1 ¶
<xref target="list-t-anchor-letters">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="counter" target="list-t-anchor-letters">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="title" target="list-t-anchor-letters"/>: list-t-anchor-letters ¶
<xref format="title" target="list-t-anchor-letters">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="none" target="list-t-anchor-letters"/>: ¶
<xref format="none" target="list-t-anchor-letters">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="default" target="list-t-anchor-letters"/>: Paragraph 1 ¶
<xref format="default" target="list-t-anchor-letters">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref target="list-t-anchor-hanging"/>: Paragraph 1 ¶
<xref target="list-t-anchor-hanging">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="counter" target="list-t-anchor-hanging">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="title" target="list-t-anchor-hanging">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="none" target="list-t-anchor-hanging"/>: ¶
<xref format="none" target="list-t-anchor-hanging">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="default" target="list-t-anchor-hanging"/>: Paragraph 1 ¶
<xref format="default" target="list-t-anchor-hanging">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref target="texttable-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="counter" target="texttable-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="title" target="texttable-anchor"/>: TEXTTABLE-TITLE ¶
<xref format="title" target="texttable-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="none" target="texttable-anchor"/>: ¶
<xref format="none" target="texttable-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="default" target="texttable-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref target="figure-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="counter" target="figure-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="title" target="figure-anchor"/>: FIGURE-TITLE ¶
<xref format="title" target="figure-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="none" target="figure-anchor"/>: ¶
<xref format="none" target="figure-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="default" target="figure-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref target="reference-anchor"/>: [reference-anchor] ¶
<xref target="reference-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT [reference-anchor] ¶
<xref format="counter" target="reference-anchor"/>: reference-anchor ¶
<xref format="counter" target="reference-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT [reference-anchor] ¶
<xref format="title" target="reference-anchor"/>: Test cases for XML2RFC formatting ¶
<xref format="title" target="reference-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT [reference-anchor] ¶
<xref format="none" target="reference-anchor"/>: ¶
<xref format="none" target="reference-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="default" target="reference-anchor"/>: [reference-anchor] ¶
<xref format="default" target="reference-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT [reference-anchor] ¶
<xref target="cref-anchor"/>: Comment cref-anchor ¶
<xref target="cref-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="counter" target="cref-anchor"/>: cref-anchor ¶
<xref format="counter" target="cref-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="title" target="cref-anchor"/>: cref-anchor ¶
<xref format="title" target="cref-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="none" target="cref-anchor"/>: ¶
<xref format="none" target="cref-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
<xref format="default" target="cref-anchor"/>: Comment cref-anchor ¶
<xref format="default" target="cref-anchor">TEXT-CONTENT</xref>: TEXT-CONTENT ¶
This section contains a couple of markup constructs carrying anchors (this is paragraph 1).¶
Some regular paragraph text... (this is paragraph 2)¶
| Some texttable text... |
|---|
| Table cell |
[cref-anchor] ¶
With content: see this sentence.¶
See also <http://greenbytes.de/tech/webdav>. Here's another one that is quite long: <http://greenbytes.de/tech/webdav/draft-reschke-rfc3744bis-issues.html#5.7_inherited-acl-set-protected>. Does it break properly?¶
See also greenbytes WebDAV resources.¶
This paragraph contains an inline iref.¶
This paragraph follows an iref.¶
A reference to Section 6.8.¶
Bar.¶
plain text.¶
the old URI spec [RFC2396].¶
With normalized whitespace.¶
With leading whitespace.¶
With trailing whitespace.¶
With extra inline whitespace.¶
This is the first sentence of the paragraph. This is the second sentence of the paragraph (with two leading blanks). Here's another sentence that was started on a separate line in the input file.¶
This is the second paragraph.¶
This paragraph has ignorable whitespace (but also contains processing instructions).¶
This paragraph has ignorable whitespace (but also contains processing instructions).¶
This paragraph has ignorable whitespace (but also contains processing instructions).¶
This paragraph has ignorable whitespace (but also contains comments).¶
This paragraph has ignorable whitespace (but also contains comments).¶
This paragraph has ignorable whitespace (but also contains comments).¶
This paragraph has ignorable whitespace (but also contains non-text-generating XML nodes).¶
This paragraph has ignorable whitespace (but also contains non-text-generating XML nodes).¶
These are tests for extensions done in rfc2629.xslt. Do not expect them to work out-of-the-box in xml2rfc.¶
Internal References: a test reference to [RFC2396] External References: a test reference to <http://xml.resource.org> a test index entry inside a figure Styling: <spanx> inside artwork
Here's a quote: This is a Quote.
¶
Here's a block level quote:¶
Foo ¶
The line above should be marked up similar to a subsection heading.¶
Referring to this section by anchor name indirectly through the references: Section 11.6 of [TSTCS].¶
Using <sourcecode>:¶
Simple <x:ref>: referencing.extensions.¶
Aliased <x:ref>: Referencing extensions.¶
Broken:¶
Ok:¶
Just a forced
line break.¶
One
blank line.¶
Seven
blank lines.¶
999
blank lines (this is likely an attempt to force a pagebreak, thus the generated HTML should not contain the blank lines, but only one).¶
First sentence (before XML comment, invisible here). Second sentence.¶
Non breaking space. Non breaking space. Non breaking space. Non breaking space. Non breaking space. Non breaking space. Non breaking space. Non breaking space. Non breaking space. Non breaking space. Non breaking space. Non breaking space. Non breaking space. Non breaking space. Non breaking space. Non breaking space. Non breaking space. Non breaking space. Non breaking space. Non breaking space. Non breaking space. Non breaking space.¶
Non-breaking-hyphen. Non-breaking-hyphen. Non-breaking-hyphen. Non-breaking-hyphen. Non-breaking-hyphen. Non-breaking-hyphen. Non-breaking-hyphen. Non-breaking-hyphen. Non-breaking-hyphen. Non-breaking-hyphen. Non-breaking-hyphen. Non-breaking-hyphen. Non-breaking-hyphen. Non-breaking-hyphen. Non-breaking-hyphen. Non-breaking-hyphen. Non-breaking-hyphen. Non-breaking-hyphen. Non-breaking-hyphen. Non-breaking-hyphen. (wrt Apache FOP, see <http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-users/200905.mbox/%3C4A035745.10601@freemail.gr%3E>)¶
mdash — with regular spaces. mdash — with regular spaces. mdash — with regular spaces. mdash — with regular spaces. mdash — with regular spaces. mdash — with regular spaces. mdash — with regular spaces. mdash — with regular spaces. mdash — with regular spaces. mdash — with regular spaces. mdash — with regular spaces. mdash — with regular spaces. mdash — with regular spaces. mdash — with regular spaces. mdash — with regular spaces. mdash — with regular spaces. mdash — with regular spaces. mdash — with regular spaces. mdash — with regular spaces. mdash — with regular spaces.¶
mdash—with no spaces. mdash—with no spaces. mdash—with no spaces. mdash—with no spaces. mdash—with no spaces. mdash—with no spaces. mdash—with no spaces. mdash—with no spaces. mdash—with no spaces. mdash—with no spaces. mdash—with no spaces. mdash—with no spaces. mdash—with no spaces. mdash—with no spaces. mdash—with no spaces. mdash—with no spaces. mdash—with no spaces. mdash—with no spaces. mdash—with no spaces. mdash—with no spaces. mdash—with no spaces. mdash—with no spaces. mdash—with no spaces. mdash—with no spaces. mdash—with no spaces.¶
mdash — with thin spaces. mdash — with thin spaces. mdash — with thin spaces. mdash — with thin spaces. mdash — with thin spaces. mdash — with thin spaces. mdash — with thin spaces. mdash — with thin spaces. mdash — with thin spaces. mdash — with thin spaces. mdash — with thin spaces. mdash — with thin spaces. mdash — with thin spaces. mdash — with thin spaces. mdash — with thin spaces. mdash — with thin spaces. mdash — with thin spaces. mdash — with thin spaces. mdash — with thin spaces. mdash — with thin spaces.¶
Expansions of "ABC":¶
with text content [RFC7749].¶
Test.¶
Using <contact> instead of <x:contributor>:¶
9. Comments
This line contains a few comments. [comment-test] This line contains a few comments. [comment1] This line contains a few comments. [comment2] This line contains a few comments. [rfc.comment.1] This line contains a few comments. [rfc.comment.2] This line contains a few comments.¶
[rfc.comment.3] ¶