diff --git a/cs675/dom_sax/JDOM.java b/cs675/dom_sax/JDOM.java new file mode 100644 index 0000000..cb06f9b --- /dev/null +++ b/cs675/dom_sax/JDOM.java @@ -0,0 +1,40 @@ + +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 "); + 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) + { + } +} diff --git a/cs675/dom_sax/JSAX.java b/cs675/dom_sax/JSAX.java new file mode 100644 index 0000000..d4cdaf2 --- /dev/null +++ b/cs675/dom_sax/JSAX.java @@ -0,0 +1,7 @@ + +public class JSAX +{ + public static void main(String args[]) + { + } +} diff --git a/cs675/dom_sax/Makefile b/cs675/dom_sax/Makefile index 11b5282..184bfc8 100644 --- a/cs675/dom_sax/Makefile +++ b/cs675/dom_sax/Makefile @@ -1,3 +1,3 @@ all: - xmllint --noout --schema dailyplanner-schema.xsd test-sched.xml + javac *.java