3 Copyright 2002-2004 The Apache Software Foundation or its licensors,
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
18 <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
21 <title>The Apache Forrest xdocs document-v2.0 DTD</title>
22 <notice>The content of this document doesn't make any sense at all.</notice>
23 <abstract>This is a demonstration document using all possible elements in
24 the current Apache Forrest xdocs <code>document-v20.dtd</code>
29 This is a demonstration document using all possible elements in the
30 current Apache Forrest xdocs <code>document-v20.dtd</code>
31 (See the <a href="#changes">DTD changes</a> section at the bottom.)
34 <title>Sample Content</title>
35 <p><strong>Hint:</strong> See the xml source to see how the various
36 elements are used and see the
37 <!-- FOR-321 workaround
38 <a href="ext:dtd-docs">DTD reference documentation</a>.
40 <a href="http://forrest.apache.org/docs/dtd-docs.html">DTD reference documentation</a>.
42 <section id="block-inline">
43 <title>Block and inline elements</title>
44 <p>This is a simple paragraph. Most documents contain a fair amount of
45 paragraphs. Paragraphs are called <code><p></code>.</p>
46 <p xml:space="preserve"
47 >With the <code><p xml:space="preserve"></code> attribute, you can declare
48 that whitespace should be preserved, without implying it is in any other
51 This next paragraph has a class attribute of 'quote'. CSS can
52 be used to present this <code><p class='quote'></code> in
53 a different style than the other paragraphs. The handling of
54 this quoted paragraph is defined in the <extra-css>
55 element in the skinconf.xml.
58 Anyway, like I was sayin', shrimp is the fruit of the sea. You can
59 barbecue it, boil it, broil it, bake it, sautee it. Dey's uh,
60 shrimp-kabobs, shrimp creole, shrimp gumbo. Pan fried, deep fried,
61 stir-fried. There's pineapple shrimp, lemon shrimp, coconut shrimp,
62 pepper shrimp, shrimp soup, shrimp stew, shrimp salad, shrimp and
63 potatoes, shrimp burger, shrimp sandwich. That- that's about it.
65 <p>A number of in-line elements are available in the DTD, we will show them
66 inside an unordered list (<code><ul></code>):</p>
68 <li>Here is a simple list item (<code><li></code>).</li>
69 <li>Have you seen the use of the <code><code></code> element in the
71 <li>Also, we have <code><sub></code> and <code><sup></code>
72 elements to show content <sup>above</sup> or <sub>below</sub> the text
74 <li>There is a facility to <em>emphasize</em> certain words using the
75 <code><em></code> <strong><code><strong></code></strong>
78 <icon height="22" width="26" src="../images/icon.png" alt="feather"/>
79 <code><icon></code>s too.</li>
80 <li>Another possibility is the <code><img></code> element:
81 <img src="../images/icon.png" alt="another feather" height="22" width="26"/>,
82 which offers the ability to refer to an image map.</li>
83 <li>We have elements for hyperlinking:
85 <dt><code><a href="faq.html"></code></dt>
87 <a href="faq.html" title="Example of a document via link">link</a>
88 to another document. As per normal, this will open the new document
89 in the same browser window.</dd>
91 <dt><code><a href="#section"></code></dt>
93 <a href="#section" title="Example of a document via local anchor">link</a>
94 to the named anchor in the current document.
97 <dt><code><a href="faq.html#forrest"></code></dt>
99 <a href="faq.html#forrest" title="Example of a document via link and anchor">link</a>
100 to another document and go to the named anchor. This will open
101 the new document in the same browser window.
103 <dt>Targetted window control with jump and fork.</dt>
104 <dd>See demonstration
105 <a href="#link-class">using class attribute on links</a>.
109 <li>Oh, by the way, a definition list <code><dl></code> was used inside
110 the previous list item. We could put another
112 <li>unordered list</li>
113 <li>inside the list item</li>
116 <caption>A sample nested table</caption>
117 <tr><td>Or even tables.. </td><td>
118 <table><tr><td>inside tables..</td></tr></table>
120 <tr><td>or inside lists, but I believe this liberty gets quickly quite
121 hairy as you see.</td></tr>
125 <p>So far for the in-line elements, let's look at some paragraph-level
127 <fixme author="SN">The <code><fixme></code> element is used for stuff
128 which still needs work. Mind the <code>author</code> attribute!</fixme>
129 <note>Use the <code><note></code> element to draw attention to something, e.g. ...The <code><code></code> element is used when the author can't
130 express himself clearly using normal sentences ;-)</note>
131 <warning>Sleep deprivation can be the result of being involved in an open
132 source project. (a.k.a. the <code><warning></code> element).
134 <note label="Important">If you want your own labels for notes and
135 warnings, specify them using the <code>label</code> attribute.
137 <p>Apart from unordered lists, we have ordered lists too, of course.</p>
141 <li>This should be 3 if my math is still OK.</li>
145 <section id="presentations">
146 <title>Various presentation formats</title>
148 <p>This sample document, written in document-v20 XML can be presented
149 via Forrest in a number of different formats. The links in the
150 following list show this document in each of the currently available
153 <p>Each of the formats can be made available as a link near the top of
154 the page. Actual placement of those links depends on the skin
155 currently in use. Those links are enabled in the skinconf.xml via the
156 <disable-XXX-link> elements in the skinconf.xml</p>
160 <th>Presentation Format</th>
164 <th>skinconf.xml Element</th>
168 <td><a href="sample.html">HTML</a></td>
170 <td>This document in HTML format. </td>
172 <td>Always generated by default. Cannot be turned off.</td>
176 <td><a href="sample.xml">XML</a></td>
178 <td>This document in its raw XML format.</td>
180 <td><disable-xml-link>. By default, set to true, meaning
181 that this link will not be shown.</td>
185 <td><a href="sample.pdf">PDF</a></td>
187 <td>This document as Adobe PDF</td>
189 <td><disable-pdf-link>. By default, set to false, meaning
190 that this link will be shown.</td>
196 <td><p>This document as straight text.</p>
197 <p>For additional information see the Forrest text-output
200 <td><disable-txt-link>. By default, set to true, meaning
201 that this link will not be shown.</td>
207 <td><p>This document as Perl POD (Plain Old Documentation). Text
208 with minimal formatting directives. If on a *nix system with perl
209 installed, see "man perlpod".</p>
210 <p>For additional information see the Forrest pod-output
213 <td><disable-pod-link>. By default, set to true, meaning
214 that this link will not be shown.</td>
218 <section id="section">
219 <title>Using sections</title>
220 <p>You can use sections to put some structure in your document. For some
221 strange historical reason, the section title is an attribute of the
222 <code><section></code> element.</p>
224 <section id="sub-section">
225 <title>Sections, the sequel</title>
226 <p>Just some second section.</p>
227 <section id="sub-sub-section">
228 <title>Section 2.1</title>
229 <p>Which contains a subsection (2.1).</p>
233 <section id="source">
234 <title>Showing preformatted source code</title>
235 <p>Enough about these sections. Let's have a look at more interesting
236 elements, <code><source></code> for instance:</p>
238 // This example is from the book _Java in a Nutshell_ by David Flanagan.
239 // Written by David Flanagan. Copyright (c) 1996 O'Reilly & Associates.
240 // You may study, use, modify, and distribute this example for any purpose.
241 // This example is provided WITHOUT WARRANTY either expressed or implied.
243 import java.applet.*; // Don't forget these import statements!
246 public class FirstApplet extends Applet {
247 // This method displays the applet.
248 // The Graphics class is how you do all drawing in Java.
249 public void paint(Graphics g) {
250 g.drawString("Hello World", 25, 50);
253 <p>CDATA sections are used within
254 <code><source></code> elements so that you can write pointy
255 brackets without needing to escape them with messy
256 <code>&lt;</code> entities ...
263 <p>Please take care to still use a sensible line-length within your
268 <title>Using tables</title>
269 <p>And now for a table:</p>
271 <caption>Table caption</caption>
273 <th>heading cell 1</th>
274 <th>heading cell 2</th>
275 <th>heading cell 3</th>
279 <td colspan="2">this data cell spans two columns</td>
283 Tables can be nested:
298 <ul><li>and can include most other elements</li><li>such as lists</li></ul>
304 <anchor id="second-figure-anchor"/>
305 <section id="figure">
306 <title>Using figures</title>
307 <p>And a <code><figure></code> to end all of this.
308 Note that this can also be implemented with an
309 <code><img></code> element.
311 <figure src="../images/project.png" alt="The fine Forrest logo" width="220" height="65"/>
313 <section id="link-class">
314 <title>Using class attribute on links</title>
316 <p>The document-v13 had elements <fork> and <jump>. In
317 document-v20, those elements no longer exist but the functionality can
318 be duplicated by using the @class attribute.
319 Even though the opening of separate windows should be under the
320 control of the user, these techniques can still be employed.</p>
324 <th><p>Document V1.3</p></th>
326 <th><p>Document V2.0</p></th>
330 <td><p><fork href="faq.html"></p></td>
332 <td><a class="fork" href="faq.html"><a class="fork"
333 href="faq.html"></a></td>
337 <td><p><jump href="faq.html"></p></td>
339 <td><p><a class="jump" href="faq.html"><a class="jump"
340 href="faq.html"></a></p></td>
346 <section id="changes">
347 <title>DTD changes</title>
349 <!-- FOR-321 workaround
350 <a href="ext:dtd-docs">DTD reference documentation</a>.
352 <a href="http://forrest.apache.org/docs/dtd-docs.html">DTD reference documentation</a>.
354 <section id="changes-20">
355 <title>Changes between document-v13 and document-v20</title>
357 <li>Renamed <strong><link></strong>
358 to <strong><a></strong>
360 <li>Removed <strong><fork></strong>
361 and <strong><jump></strong> in favour of the
362 <strong><a></strong> element. See demonstration
363 <a href="#link-class">using class attribute on links</a>.
367 <section id="changes-13">
368 <title>Changes between document-v12 and document-v13</title>
370 All v1.2 docs will work fine as v1.3 DTD. The main change is the
371 addition of a @class attribute to every element, which enables the
372 "extra-css" section in the skinconf to be put to good use.
375 <section id="changes-12">
376 <title>Changes between document-v11 and document-v12</title>
378 doc-v12 enhances doc-v11 by relaxing various restrictions that were
379 found to be unnecessary.
383 Links ((link|jump|fork) and inline elements (br|img|icon|acronym) are
384 allowed inside title.
387 Paragraphs (p|source|note|warning|fixme), table and figure|anchor are
391 Paragraphs (p|source|note|warning|fixme), lists (ol|ul|dl), table,
392 figure|anchor are allowed inside definition lists (dd) and tables (td
397 (strong|em|code|sub|sup|br|img|icon|acronym|link|jump|fork) is
398 allowed in strong and em.
405 <legal>This is a legal notice, so it is <strong>important</strong>.</legal>