XML2RFC Test Cases | J. F. Reschke |
greenbytes | |
July 2024 |
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.¶
title |
---|
1 |
2 |
title |
---|
left |
---|
1 |
center |
---|
1 |
right |
---|
1 |
default |
---|
1 |
with preamble, no title...
+--+ | | +--+
+--+ | | +--+
with postamble and title...
Figure 2: another figure
The figure above has the title "another figure".¶
Para...¶
Leading whitespace
test test (leading ws)
Para...¶
Trailing whitespace
test test (trailing ws)
Para...¶
No whitespace
test test (no ws)
Para...¶
spacing paragraph¶
ART
spacing paragraph¶
preamble, then
ART
spacing paragraph¶
ART
then postamble
spacing paragraph¶
preamble
postamble
preamble
FOO
postamble
preamble
postamble
preamble
FOO
postamble
preamble
postamble
preamble
FOO
postamble
preamble
postamble
preamble
FOO
postamble
Both figure and artwork having @src:¶
Preamble...
figure/align=right, artwork/@align=center:¶
Preamble...
TEST
Postamble...
Figure 25: title
figure/align=right, artwork/@align not specified:¶
Preamble...
TEST
Postamble...
Figure 26: title
FOO
Figure 27
FOO
FOO
Figure 29: figure title
FOO
Figure 30: figure title
Inclusion of SVG:¶
Marking up Code Components according to the Legal Provisions Relating to IETF Documents:¶
Using @x:is-code-component¶
<CODE BEGINS>
int main(int argc, char **argv) { return -1; }
<CODE ENDS>
Using @markers¶
<CODE BEGINS>
int main(int argc, char **argv) { return -1; }
<CODE ENDS>
Using @markers and @name¶
<CODE BEGINS> file "abc.c"
int main(int argc, char **argv) { return -1; }
<CODE ENDS>
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)¶
NOTE: '\\' line wrapping per RFC 8792
012345678901234567890123456789012345678901234567890123456789\
01234567890123456789
FOOBAR
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 |
Some figure text...
Figure 34: FIGURE-TITLE
[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).¶
This should fit (69 characters plus three spaces of indentation in text output).
012345678901234567890123456789012345678901234567890123456789012345678
This shouldn't.
0123456789012345678901234567890123456789012345678901234567890123456789
(IN TEXT OUTPUT INDENTED BY 10) 012345678901234567890123456789012345678901234567890123456789012
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
PUT / HTTP/1.1
Host: example.org
Content-Type: application/xml
Content-Length: 6
<foo/>
...without indentation:
PUT / HTTP/1.1
Host: example.org
Content-Type: text/plain
Content-Length: 16
Line 1
Line 2
...with indentation:
PUT / HTTP/1.1
Host: example.org
Content-Type: text/plain
Content-Length: 16
Line 1
Line 2
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.¶
The figure below should use box drawing characters instead of "+", "-" and "|".
┌────────────────┐ │ This is a Box. │ └────────────────┘
Referring to this section by anchor name indirectly through the references: Section 11.6 of [TSTCS].¶
Default inside a figure: [TSTCS], Section 11.6
case-insensitive1 = "abcdefghijlkmnopqrstuvwxyz" case-insensitive2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" case-sensitive1 = %x61.62.63.64.65.66.67.68.69.6A.6C.6B.6D.6E.6F.70.71.72.73.74.75.76.77.78.79.7A case-sensitive2 = %x41.42.43.44.45.46.47.48.49.4A.4B.4C.4D.4E.4F.50.51.52.53.54.55.56.57.58.59.5A
Extensions from RFC 9110:
x = 1#2y
Extensions from RFC 7405:
x = %s"case-sensitive" y = %i"case-insensitive"
Literals:
binary = %b00-11 %b00.01.10.11 dec = %d13.10 hex = %x0F.0A DIGIT = %x30-39 DIGIT2 = %x30.31.32.33.34.35.36.37.38.39 ; comment string = "abcde <y>" string = "foo;bar"
Broken literals:
binary = %b00-12 DIGIT = %x30-39-4A string = "abcde"fgh"
Prose:
foo = <simple prose string> bar = <with "double quotes"> qux = <with '<' inside>
Using <sourcecode>:¶
left = right ; comment
Broken prose and string literals:
foo = <no ABNF available,
but that does not justify a line break>
extra = <good>bad ; comment
bar = "illegal characters in string literal: ␉"
qux = "runaway string
qux2 = "in string literal"
Simple <x:ref>: referencing.extensions.¶
Aliased <x:ref>: Referencing extensions.¶
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] ¶