Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/eireneh/bible/Test.java


1   package com.eireneh.bible;
2   
3   import java.io.*;
4   
5   import org.jdom.*;
6   import org.jdom.output.*;
7   
8   /**
9    *
10   * licence  insert goes here
11   * @see <a href='http://www.eireneh.com/servlets/Web'>Project B Home</a>
12   * @see docs.Licence
13   * @author Joe Walker
14   * @version $Id:$
15   */
16  public class Test
17  {
18      public Test()
19      {
20          Element root = new Element("top");
21          Document doc = new Document(root);
22          root.setText("hello");
23  
24          root.addContent(new FooterElement(2000));
25  
26          try
27          {
28              XMLOutputter serializer = new XMLOutputter();
29              serializer.output(doc, System.out);
30          }
31          catch (IOException ex)
32          {
33              System.err.println(ex);
34          }
35      }
36  
37      public static void main(String[] args)
38      {
39          Test test1 = new Test();
40      }
41  
42      public class FooterElement extends Element
43      {
44          public FooterElement(int year)
45          {
46              super("footer");
47              addAttribute("year", ""+year);
48              addContent("copyright").setText("JavaWorld "+year);
49          }
50      }
51  }