Monday, 1 August 2011

Adding an Attribute Using JDOM

   

import org.jdom.Document;
import org.jdom.Element;

public class MainClass {

  public static void main(String args[]) {

    Document doc = new Document(new Element("games"));
    Element newGame = new Element("game").setText("Final Fantasy");
    doc.getRootElement().addContent(newGame);
    newGame.setAttribute("genre""rpg");

  }

}

   
    
  

No comments:

Post a Comment