FileDocCategorySizeDatePackage
HelloManipulation.javaAPI DocExample837Thu Apr 05 20:34:28 BST 2001None

HelloManipulation

public class HelloManipulation extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

    // Some pseudo-dynamic content
    String username = "Mark Diekhans";
    int numMessages = 43;

    // Create the DOM tree
    Hello hello = new Hello();

    // Set the title, using a standard DOM method
    hello.setTitle("Hello XMLC!");

    // Set the value for "greeting"
    hello.setTextGreeting("Hello, " + username);

    // Set the value for "messages"
    hello.setTextMessages("" + numMessages);

    try {
      DOMFormatter formatter = new DOMFormatter();  // can be heavily tweaked
      formatter.write(hello, System.out);
    }
    catch (IOException e) {
      e.printStackTrace();
    }