added skeleton java files
git-svn-id: svn://anubis/gvsu@120 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
parent
b9bb5cce1c
commit
aabe876290
40
cs675/dom_sax/JDOM.java
Normal file
40
cs675/dom_sax/JDOM.java
Normal file
@ -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 <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)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
7
cs675/dom_sax/JSAX.java
Normal file
7
cs675/dom_sax/JSAX.java
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
public class JSAX
|
||||||
|
{
|
||||||
|
public static void main(String args[])
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +1,3 @@
|
|||||||
|
|
||||||
all:
|
all:
|
||||||
xmllint --noout --schema dailyplanner-schema.xsd test-sched.xml
|
javac *.java
|
||||||
|
Loading…
x
Reference in New Issue
Block a user