MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

import org.w3c.dom.Document;
import org.apache.xerces.dom.DOMImplementation;
import org.w3c.dom.Element;

public class MainClass {

    public static void main(String args[]) {
        Document dom = DOMImplementation.createDocument(null, null, null);
        Element root = dom.createElement("games");
        Element child1 = dom.createElement("game");
        root.appendChild(child1);
        child1.setAttribute("A", "a");
    }

}