41 lines
874 B
Java
41 lines
874 B
Java
|
|
import javax.xml.parsers.*;
|
|
import org.w3c.dom.*;
|
|
|
|
public class JDOM
|
|
{
|
|
public static int main(String args[])
|
|
{
|
|
if (args.length != 1)
|
|
{
|
|
System.err.println("Usage: java JDOM <XMLFile>");
|
|
return 42;
|
|
}
|
|
JDOM j = new JDOM();
|
|
return j.parse(args[0]);
|
|
}
|
|
|
|
public int parse(String file)
|
|
{
|
|
Document doc = null;
|
|
try
|
|
{
|
|
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
|
DocumentBuilder db = dbf.newDocumentBuilder();
|
|
doc = db.parse(file);
|
|
if (doc != null)
|
|
printHTMLSchedule(doc);
|
|
return 0;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
System.out.println(e.getMessage());
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
private void printHTMLSchedule(Document d)
|
|
{
|
|
}
|
|
}
|