source: rfc2629xslt/testcase.xml @ 120

Last change on this file since 120 was 6, checked in by fielding@…, 12 years ago

XSLT stylesheet for enhanced RFC2629 xml2rfc output as HTML.
By Julian Reschke

Obtained from: wget -N http://www.greenbytes.de/tech/webdav/rfc2629xslt.zip

  • Property svn:eol-style set to native
File size: 16.7 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
3<?rfc toc="yes"?>
4<?rfc symrefs="yes"?>
5<?rfc comments="yes"?>
6<?rfc inline="no"?>
7<?rfc-ext include-references-in-index="yes" ?>
8<?rfc-ext parse-xml-in-artwork="yes" ?>
9<?rfc-ext allow-markup-in-artwork="yes" ?>
10<?rfc-ext para-anchors="yes" ?>
11<?rfc private="RFC2629 test cases"?>
12<!DOCTYPE rfc
13  SYSTEM "rfc2629.dtd">
14<rfc xmlns:x="http://purl.org/net/xml2rfc/ext">
15        <front>
16        <title>Test cases for RFC2629 formatting</title>
17
18        <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke">
19                <organization abbrev="greenbytes">greenbytes GmbH</organization>
20        <address>
21                <postal>
22                <street>Hafenweg 16</street>
23            <city>Muenster</city><region>NW</region><code>48155</code>
24                <country>Germany</country>
25                </postal>
26                  <phone>+49 251 2807760</phone>       
27        <facsimile>+49 251 2807761</facsimile> 
28                  <email>julian.reschke@greenbytes.de</email>   
29                  <uri>http://greenbytes.de/tech/webdav/</uri> 
30                </address>
31        </author>
32     
33    <date month="December" year="2007"/>
34    <keyword>RFC2629</keyword>
35    <keyword>test case</keyword>
36    <keyword>xml2rfc</keyword>
37        </front>
38
39        <middle>
40
41<section title="Lists" anchor="lists">
42<section title="hanging list">
43<t><list style="hanging">
44  <t hangText="Name:">timeout</t>
45  <t hangText="Namespace:">DAV:</t>
46  <t hangText="Purpose:">The timeout associated with a lock</t>
47  <t hangText="Value:">TimeType ;Defined in section 9.8</t>
48</list></t></section>
49
50<section title="numbered list">
51<t>
52A numbered list:
53<list style="numbers">
54  <t>one</t>
55  <t>two</t>
56  <t>three</t>
57</list>
58</t>
59</section>
60
61<section title="ordered list (letters)" anchor="ordered.list.letters">
62<t>
63An ordered list using letters:
64<list style="letters">
65  <t>one</t>
66  <t>two</t>
67  <t>three</t>
68  <t>one</t>
69  <t>two</t>
70  <t>three</t>
71  <t>one</t>
72  <t>two</t>
73  <t>three</t>
74  <t>one</t>
75  <t>two</t>
76  <t>three</t>
77  <t>one</t>
78  <t>two</t>
79  <t>three</t>
80  <t>one</t>
81  <t>two</t>
82  <t>three</t>
83  <t>one</t>
84  <t>two</t>
85  <t>three</t>
86  <t>one</t>
87  <t>two</t>
88  <t>three</t>
89  <t>one</t>
90  <t>two</t>
91  <t>three</t>
92  <t>one</t>
93  <t>two</t>
94  <t anchor="ordered.list.letters.last">three</t>
95</list>
96</t>
97</section>
98
99<section title="no explicit counters">
100<t>
101  Example for numbered list with user-defined-format:
102  <list style="format R%d:">
103    <t>R1</t>
104    <t>R2</t>
105  </list>
106</t>
107<t>
108  Another list:
109  <list style="format S%d:">
110    <t>S1</t>
111    <t>S2</t>
112  </list>
113</t>
114<t>
115  Next list should continue counting R's:
116  <list style="format R%d:">
117    <t>R3</t>
118    <t>R4</t>
119  </list>
120</t>
121<t>
122  Same with character-based numbering:
123  <list style="format c-%c:">
124    <t>c-a</t>
125    <t>c-b</t>
126  </list>
127</t>
128</section>
129
130<section title="with explicit counters">
131<t>
132  A few requirements:
133  <list style="format R%d:" counter="requirements">
134    <t>req R1</t>
135    <t>req R2</t>
136  </list>
137</t>
138<t>
139  More requirements:
140  <list style="format R%d:" counter="requirements">
141    <t>req R3</t>
142    <t>req R4</t>
143  </list>
144</t>
145<t>
146  A few rules:
147  <list style="format R%d:" counter="rules">
148    <t>rule R1</t>
149    <t>rule R2</t>
150    <t>rule R3</t>
151  </list> 
152</t>
153<t>
154  Explicit counter with name matching it's format string:
155  <list style="format c-%c:" counter="c-%c:">
156    <t>c-c</t>
157    <t>c-d</t>
158  </list>
159</t>
160<t>
161  Same, without counter:
162  <list style="format c-%c:">
163    <t>c-e</t>
164    <t>c-f</t>
165  </list>
166 </t>
167</section>
168
169<section title="Nested list">
170  <t>
171    <list style="numbers">
172      <t>One</t>
173      <t>Two
174        <list style="letters">
175          <t>17</t>
176          <t>42</t>
177        </list>
178      </t>
179      <t>Three</t>
180    </list>
181  </t>
182</section>
183
184<section title="list without style">
185<t><list>
186  <t>One</t>
187  <t>Two</t>
188  <t>Three</t>
189</list></t></section>
190
191<section title="list with multiple paragraphs in a single list item">
192<t><list style="numbers">
193  <x:lt><t>Simple list item.</t></x:lt>
194  <x:lt>
195    <t>This one has two paragraphs. This is the first one.</t>
196    <t>This one has two paragraphs. This is the second one.</t>
197  </x:lt>
198  <x:lt><t>Another simple list item.</t></x:lt>
199</list></t></section>
200
201</section>
202
203<section title="spanx">
204<t>
205This is <spanx>default</spanx>.
206</t>
207<t>
208This is <spanx style="emph">emph(asized)</spanx>.
209</t>
210<t>
211This is <spanx style="strong">strong</spanx>.
212</t>
213<t>
214This is <spanx style="verb">verb(atim)</spanx>.
215</t>
216<t>
217Here is <spanx style="verb">a carriage return
218inside</spanx> a spanx element.
219</t>
220</section>
221
222<section title="Tables">
223<texttable>
224<preamble>The list of valid keywords are:</preamble>
225<ttcol width="20%" align="right">keyword</ttcol>
226<ttcol width="20%" align="center">default</ttcol>
227<ttcol align="left">meaning</ttcol>
228<ttcol>not aligned</ttcol>
229
230<c>strict</c>
231<c>no</c>
232<c>try to enforce the ID-nits conventions and DTD validity</c>
233<c>a</c>
234
235<c>iprnotified</c>
236<c>no</c>
237<c>include boilerplate from Section 10.4(d) of <xref target="RFC2026"/></c>
238<c>bb bb</c>
239
240<c>compact</c>
241<c>no</c>
242<c>when producing a txt/nroff file, try to conserve vertical whitespace</c>
243<c>ccc ccc ccc</c>
244   
245<c>subcompact</c>
246<c>compact</c>
247<c>if compact is "yes", then setting this to "no" will make things a little less
248compact</c>
249<c>dddd dddd dddd dddd</c>
250   
251<!--
252    ...                                                          ...
253   
254  -->
255   
256<c>needLines</c>
257<c>n/a</c>
258<c>an integer hint indicating how many contiguous lines are needed at this point
259in the output</c>
260<c>eeeee eeeee eeeee eeeee eeeee </c>
261
262<c>here come empty cells</c>
263<c></c>
264<c/>
265<c/>
266
267<postamble>Remember,
268that as with everything else in XML,
269keywords and values are case-sensitive.</postamble>
270</texttable>
271
272<section title="no borders">
273<texttable style="none" anchor="tablenoborder" title="a table with no borders">
274<preamble>The table below should appear with no borders.</preamble>
275<ttcol>C1</ttcol>
276<ttcol>C2</ttcol>
277<c>11</c>
278<c>12</c>
279<c>21</c>
280<c>22</c>
281</texttable>
282</section>
283
284<section title="borders around headers">
285<texttable style="headers">
286<preamble>The table below should appear with borders just around the headers.</preamble>
287<ttcol>C1</ttcol>
288<ttcol>C2</ttcol>
289<c>11</c>
290<c>12</c>
291<c>21</c>
292<c>22</c>
293</texttable>
294</section>
295
296<section title="referencing tables">
297  <t>
298    <xref target="tablenoborder"/> shows a table with no borders.
299  </t>
300  <t>
301    <xref target="tablenoborder">The table above</xref> shows a table with no borders.
302  </t>
303</section>
304
305</section>
306
307
308<section title="Figures">
309<section title="with preamble, no title...">
310<figure>
311  <preamble>with preamble, no title...</preamble>
312  <artwork>
313  +--+
314  |  |
315  +--+
316</artwork>
317</figure>
318</section>
319
320<section title="with postamble and title...">
321<figure title="another figure" anchor="testfig">
322  <artwork>
323  +--+
324  |  |
325  +--+
326</artwork>
327<postamble>with postamble and title...</postamble>
328</figure>
329<t>
330  The figure above has the title "<xref target="testfig" format="title" />".
331</t>
332</section>
333
334<section title="Whitespace handling">
335<t>
336  Para...
337</t> 
338<figure>
339  <preamble>Leading whitespace</preamble>
340  <artwork>
341test test (leading ws)</artwork>
342</figure>
343<t>
344  Para...
345</t> 
346<figure>
347  <preamble>Trailing whitespace</preamble>
348  <artwork>test test (trailing ws)
349   </artwork>
350</figure>
351<t>
352  Para...
353</t> 
354<figure>
355  <preamble>No whitespace</preamble>
356  <artwork>test test (no ws)</artwork>
357</figure>
358<t>
359  Para...
360</t> 
361</section>
362
363<!-- as proposed by Bill F -->
364<section title="Whitespace around figures">
365<t>spacing paragraph</t>
366<figure><artwork>ART</artwork></figure>
367<t>spacing paragraph</t>
368<figure><preamble>preamble, then</preamble><artwork>ART</artwork></figure>
369<t>spacing paragraph</t>
370<figure><artwork>ART</artwork><postamble>then postamble</postamble></figure>
371<t>spacing paragraph</t>
372</section>
373
374</section>
375
376<section title="References" anchor="refs">
377
378<section title="xref with no content">
379<t>
380We are in <xref target="refs" />.
381</t>
382</section>
383
384<section title="xref with no content" anchor="xref.with.no.content">
385<t anchor="xref.with.no.content.first.sentence">
386<xref target="refs" /> is the parent section.
387</t>
388</section>
389
390<section title="xref to named &lt;t> element">
391<t>
392  See <xref target="xref.with.no.content.first.sentence" format="none">first sentence</xref>
393  of previous section.
394</t>
395</section>
396
397<section title="xref to named &lt;t> element inside list">
398<t>
399  See <xref target="ordered.list.letters.last" format="none">last entry</xref> in
400  <xref target="ordered.list.letters"/>.
401</t>
402</section>
403
404<section title="xref with no auto-formatting">
405<t>
406So far we have sections <xref target="lists" format="counter" /> ("<xref target="lists" format="title" />") through <xref target="refs" format="counter"/>
407("<xref target="refs" format="title"/>").
408</t>
409</section>
410
411<section title="xref with content and auto-formatting">
412<t>
413This is a subsection of <xref target="refs">References</xref>.
414</t>
415</section>
416
417<section title="xref with content and no formatting">
418<t>
419This is a subsection of <xref target="refs" x:fmt="none">References</xref>.
420Here we are referring to <xref target="RFC2026" x:fmt="none">RFC 2026</xref>,
421without emitting extra formatting.
422</t>
423</section>
424
425<section title="xref with no content and anchor formatting">
426<t>
427See [<xref target="RFC2026" x:fmt="anchor"/>, <xref target="RFC2396" x:fmt="anchor"/>].
428</t>
429</section>
430
431<section title="eref with no content">
432<t>
433See also <eref target="http://greenbytes.de/tech/webdav" />. Here's another
434one that is quite long: <eref target="http://greenbytes.de/tech/webdav/draft-reschke-rfc3744bis-issues.html#5.7_inherited-acl-set-protected"/>. Does it break properly?
435</t>
436</section>
437
438<section title="eref with content">
439<t>
440See also <eref target="http://greenbytes.de/tech/webdav">greenbytes WebDAV resources</eref>.
441</t>
442</section>
443
444</section>
445
446<section title="Paragraph formatting">
447<t>
448  This is the first sentence of the paragraph.  This is the second sentence of
449  the paragraph (with two leading blanks).
450  Here's another sentence that was started on a separate line in the input
451  file.
452</t>
453<t>
454  This is the second paragraph.
455</t>
456</section>
457
458<section title="Sections">
459
460<section title="Subsection with TOC entry">
461</section>
462
463<section title="Subsection without TOC entry" toc="exclude">
464
465<section title="Sub-subsection with TOC entry">
466</section>
467
468</section>
469
470</section>
471
472<section title="Comments">
473<t>
474  This line contains a few comments.
475  <cref source="JRE">No anchor, source given.</cref>
476  This line contains a few comments.
477  <cref anchor="comment1">Anchor given, no source.</cref>
478  This line contains a few comments.
479  <cref anchor="comment2" source="JRE">Both specified.</cref>
480  This line contains a few comments.
481  <cref>No anchor, no source.</cref>
482  This line contains a few comments.
483</t>
484</section>
485
486<section title="Artwork width">
487<figure>
488<preamble>
489This should fit (69 characters plus three spaces of indentation in text output).
490</preamble>
491<artwork>
492012345678901234567890123456789012345678901234567890123456789012345678
493</artwork>
494</figure>
495<figure>
496<preamble>
497This shouldn't.
498</preamble>
499<artwork>
5000123456789012345678901234567890123456789012345678901234567890123456789
501</artwork>
502</figure>
503</section>
504
505<section title="Extensions" anchor="extensions">
506<t>
507  These are tests for extensions done in <spanx style="verb">rfc2629.xslt</spanx>.
508  Do not expect them to work out-of-the-box in <spanx style="verb">xml2rfc</spanx>.
509</t>
510<section title="Markup in figure/artwork">
511<figure>
512<artwork>
513Internal References: a test reference to <xref target="RFC2396"/>
514
515External References: a test reference to <eref target="http://xml.resource.org"/>
516
517<iref item="&lt;iref> in &lt;artwork>"/>a test index entry inside a figure
518
519Styling: <spanx>&lt;spanx></spanx> inside artwork
520</artwork>
521</figure>
522</section>
523
524<section title="Quotations">
525  <t>
526    Here's a quote:
527    <x:q>This is a Quote.</x:q>
528  </t>
529  <t>
530    Here's a block level quote:
531  </t>
532  <x:blockquote>
533    <t>
534      Here's a quote.
535    </t>
536    <t>
537      More text.
538    </t>
539  </x:blockquote>
540</section>
541
542<section title="Subsections">
543  <t>
544    <x:h>Foo</x:h>
545  </t>
546  <t>
547    The line above should be marked up similar to a subsection heading.
548  </t>
549</section>
550
551<section title="Box Drawing">
552<figure>
553  <preamble>
554    The figure below should use box drawing characters instead of
555    "+", "-" and "|".
556  </preamble>
557  <artwork>
558  <x:bt>+----------------+</x:bt>
559  <x:bc>| This is a Box. |</x:bc>
560  <x:bb>+----------------+</x:bb>
561  </artwork>
562</figure>
563
564</section>
565
566<section title="Computed Reference Targets" anchor="computed.reference.targets">
567<t>
568  Referring to this section by anchor name indirectly through the references:
569  <xref target="TSTCS" x:fmt="of" x:rel="#computed.reference.targets"/>.
570</t>
571<t>
572  (default formatting):
573  <xref target="TSTCS" x:rel="#computed.reference.targets"/>.
574</t>
575<figure><artwork>
576  Default inside a figure: <xref target="TSTCS" x:rel="#computed.reference.targets"/>
577</artwork></figure>
578<t>
579  With a broken anchor:
580  <xref target="TSTCS" x:rel="#a-target-that-isnt-defined"/>.
581</t>
582</section>
583
584
585</section>
586
587<section title="Blank Lines">
588<t>
589Just a forced <vspace/>
590line break.
591</t>
592<t>
593One <vspace blankLines="1"/>
594blank line.
595</t>
596<t>
597Seven <vspace blankLines="7"/>
598blank lines.
599</t>
600</section>
601
602
603
604    </middle>
605
606        <back>
607  <references>
608  <reference anchor='RFC2026'>
609
610<front>
611<title abbrev='Internet Standards Process'>The Internet Standards Process -- Revision 3</title>
612<author initials='S.' surname='Bradner' fullname='Scott O. Bradner'>
613<organization>Harvard University</organization>
614<address>
615<postal>
616<street>1350 Mass. Ave.</street>
617<city>Cambridge</city>
618<region>MA</region>
619<code>02138</code>
620<country>US</country></postal>
621<phone>+1 617 495 3864</phone>
622<email>sob@harvard.edu</email></address></author>
623<date month='October' year='1996' />
624<abstract>
625<t>This memo documents the process used by the Internet community for the standardization of protocols and procedures.  It defines the stages in the standardization process, the requirements for moving a document between stages and the types of documents used during this process.  It also addresses the intellectual property rights and copyright issues associated with the standards process.</t></abstract></front>
626
627<seriesInfo name='BCP' value='9' />
628<seriesInfo name='RFC' value='2026' />
629<format type='TXT' octets='86731' target='ftp://ftp.isi.edu/in-notes/rfc2026.txt' />
630</reference>
631
632<reference anchor="RFC2396">
633
634<front>
635<title abbrev="URI Generic Syntax">Uniform Resource Identifiers (URI): Generic Syntax</title>
636<author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
637<organization>World Wide Web Consortium</organization>
638<address>
639<postal>
640<street>MIT Laboratory for Computer Science, NE43-356</street>
641<street>545 Technology Square</street>
642<city>Cambridge</city>
643<region>MA</region>
644<code>02139</code></postal>
645<facsimile>+1(617)258-8682</facsimile>
646<email>timbl@w3.org</email></address></author>
647<author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
648<organization>Department of Information and Computer Science</organization>
649<address>
650<postal>
651<street>University of California, Irvine</street>
652<city>Irvine</city>
653<region>CA</region>
654<code>92697-3425</code></postal>
655<facsimile>+1(949)824-1715</facsimile>
656<email>fielding@ics.uci.edu</email></address></author>
657<author initials="L." surname="Masinter" fullname="Larry Masinter">
658<organization>Xerox PARC</organization>
659<address>
660<postal>
661<street>3333 Coyote Hill Road</street>
662<city>Palo Alto</city>
663<region>CA</region>
664<code>94034</code></postal>
665<facsimile>+1(415)812-4333</facsimile>
666<email>masinter@parc.xerox.com</email></address></author>
667<date month="August" year="1998"/>
668<area>Applications</area>
669<keyword>uniform resource</keyword>
670<keyword>URI</keyword>
671</front>
672<seriesInfo name="RFC" value="2396"/>
673<annotation>
674  This RFC will soon be updated, check
675  <eref target="http://cvs.apache.org/viewcvs.cgi/*checkout*/ietf-uri/rev-2002/rfc2396bis.html" /> for the latest draft.
676</annotation>
677<annotation>
678  The issues list is at <eref target="http://cvs.apache.org/viewcvs.cgi/*checkout*/ietf-uri/rev-2002/issues.html" />.
679</annotation>
680
681</reference>
682
683<reference anchor="TSTCS">
684        <front>
685        <title>Test cases for RFC2629 formatting</title>
686
687        <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke">
688                <organization abbrev="greenbytes">greenbytes GmbH</organization>
689        <address>
690                <postal>
691                <street>Hafenweg 16</street>
692            <city>Muenster</city><region>NW</region><code>48155</code>
693                <country>Germany</country>
694                </postal>
695                  <phone>+49 251 2807760</phone>       
696        <facsimile>+49 251 2807761</facsimile> 
697                  <email>julian.reschke@greenbytes.de</email>   
698                  <uri>http://greenbytes.de/tech/webdav/</uri> 
699                </address>
700        </author>
701    <date month="October" year="2007"/>
702        </front>
703  <x:source href="testcase.xml"/>
704</reference>
705
706  </references>
707  </back>
708</rfc>
Note: See TracBrowser for help on using the repository browser.