From forrest-dev-return-2634-apmail-xml-forrest-dev-archive=xml.apache.org@xml.apache.org Fri Oct 11 15:24:37 2002 Return-Path: Delivered-To: apmail-xml-forrest-dev-archive@xml.apache.org Received: (qmail 59241 invoked by uid 500); 11 Oct 2002 15:24:36 -0000 Mailing-List: contact forrest-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: forrest-dev@xml.apache.org Delivered-To: mailing list forrest-dev@xml.apache.org Received: (qmail 59173 invoked by uid 500); 11 Oct 2002 15:24:34 -0000 Delivered-To: apmail-xml-forrest-cvs@apache.org Received: (qmail 59152 invoked from network); 11 Oct 2002 15:24:34 -0000 Received: from icarus.apache.org (63.251.56.143) by daedalus.apache.org with SMTP; 11 Oct 2002 15:24:34 -0000 Received: (qmail 94181 invoked by uid 1352); 11 Oct 2002 15:24:34 -0000 Date: 11 Oct 2002 15:24:34 -0000 Message-ID: <20021011152434.94180.qmail@icarus.apache.org> From: jefft@apache.org To: xml-forrest-cvs@apache.org Subject: cvs commit: xml-forrest/src/resources/fresh-site/src/documentation/content/xdocs sample.xml X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Status: O X-Status: X-Keywords: jefft 2002/10/11 08:24:34 Added: src/resources/fresh-site/src/documentation/content/xdocs sample.xml Log: Add a sample xdoc to demonstrate what's possible Revision Changes Path 1.1 xml-forrest/src/resources/fresh-site/src/documentation/content/xdocs/sample.xml Index: sample.xml ===================================================================
The document-v1.1 DTD This document doesn't make any sense at all. A nonsense document using all possible elements in the current document-v11.dtd.

This is a simple paragraph. Most documents contain a fair amount of paragraphs. Paragraphs are called <p>.

A number of in-line elements are available in the DTD, we will show them inside an unordered list (<ul>):

  • Here is a simple list item (<li>).
  • Have you seen the use of the <code> element in the previous item?
  • Also, we have <sub> and <sup> elements to show content above or below the text baseline.
  • There is a facility to emphasize certain words using the <em> element.
  • We can use <icon>s, too.
  • Another possibility is the <img> element: another feather, which offers the ability to refer to an image map.
  • We have elements for hyperlinking:
    <link href="faq.html">
    Use this to link to another document. As per normal, this will open the new document in the same browser window.
    <link href="#section">
    Use this to link to the named anchor in the current document.
    <link href="contrib.html#cvshowto">
    Use this to link to another document and go to the named anchor. This will open the new document in the same browser window.
    <jump href="contrib.html">
    Use this to jump to another document and optionally go to a named anchor within that document. This will open the new document in the same browser window. So what is the difference between link and jump? The jump behaves differently, in that it will replace any frames in the current window. This is the equivalent of <a ... target="_top">
    <fork href="faq.html">
    Use this to fork your webbrowser to another document. This will open the document in a new, unnamed browser window. This is the equivalent of <a ... target="_blank">
  • Oh, by the way, a definition list <dl> was used inside the previous list item. We could put another
    • unordered list
    • inside the list item
    too, but I believe this liberty gets quickly quite hairy as you see.

So far for the in-line elements, let's look at some paragraph-level elements.

The <fixme> element is used for stuff which still needs work. Mind the author attribute! Use the <note> element to draw attention to something, e.g. ...The <code> element is used when the author can't express himself clearly using normal sentences ;-) Sleep deprivation can be the result of being involved in an open source project. (a.k.a. the <warning> element).

Apart from unordered lists, we have ordered lists too, of course.

  1. Item 1
  2. Item 2
  3. This should be 3 if my math is still OK.
Using sections

You can use sections to put some structure in your document. For some strange historical reason, the section title is an attribute of the <section> element.

Sections, the sequel

Just some second section.

Section 2.1

Which contains a subsection (2.1).

Showing preformatted source code

Enough about these sections. Let's have a look at more interesting elements, <source> for instance:

// This example is from the book _Java in a Nutshell_ by David Flanagan. // Written by David Flanagan. Copyright (c) 1996 O'Reilly & Associates. // You may study, use, modify, and distribute this example for any purpose. // This example is provided WITHOUT WARRANTY either expressed or implied. import java.applet.*; // Don't forget these import statements! import java.awt.*; public class FirstApplet extends Applet { // This method displays the applet. // The Graphics class is how you do all drawing in Java. public void paint(Graphics g) { g.drawString("Hello World", 25, 50); } }

Please take care to still use a sensible line-length within your source elements.

Using tables

And now for a table:

Table caption
heading cell heading cell
data cell data cell

Not much of attributes with <table>, if you ask me.

Using figures

And a figure to end all of this.