<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2713.1100" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>What about my code here.</FONT></DIV>
<DIV><FONT face=Arial size=2>It's giving me all sorts of errors on class and 
method; symbols not beign resolved and so on.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Can anyone tell where i'm wrong in 
this?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>[code]</FONT></DIV>
<DIV><FONT face=Arial size=2>import java.io.File;<BR>import 
java.io.IOException;<BR>import java.io.OutputStream;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>import org.jdom.Attribute;<BR>import 
org.jdom.Comments;<BR>import org.jdom.DocType;<BR>import 
org.jdom.Document;<BR>import org.jdom.Element;<BR>import 
org.jdom.JDOMException;<BR>import org.jdom.Namespace;<BR>import 
org.jdom.ProcessingInstruction;<BR>import org.jdom.input.DOMBuilder;<BR>import 
org.jdom.input.SAXBuilder;<BR>import org.jdom.output.XMLOutputter;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>public class JDOMTest{<BR>&nbsp;public 
JDOMTest(){<BR>&nbsp;}<BR>&nbsp;<BR>&nbsp;public void newDocument(OutputStream 
out)<BR>&nbsp;&nbsp;throws IOException, JDOMExcption {<BR>&nbsp;&nbsp;Namespace 
ns = Namespace.getNamespace("linux","<A 
href="http://www.linux.org">http://www.linux.org</A>");<BR>&nbsp;&nbsp;Document 
doc = new Document (new Element("config", 
ns))<BR>&nbsp;&nbsp;&nbsp;.setDocType(new DocType("linux:config", 
"DTD/linux.dtd"))<BR>&nbsp;&nbsp;&nbsp;.addProcessingInstruction("cocoon-process", 
"type=\"xsp\"");<BR>&nbsp;&nbsp;&nbsp;.addProcessingInstruction(new 
ProcessingInstruction("cocoon-process", 
"type=\"xslt\""));<BR>&nbsp;&nbsp;doc.getRootElement()<BR>&nbsp;&nbsp;&nbsp;.addAttribute("Kernel", 
"2.2.14")<BR>&nbsp;&nbsp;&nbsp;.addAttribute(new Attribute("dist", "RedHat 
6.1"))<BR>&nbsp;&nbsp;&nbsp;.addAttribute(new Element("gui", 
ns)<BR>&nbsp;&nbsp;&nbsp;&nbsp;.setContent("No Window Manager 
Installed"))<BR>&nbsp;&nbsp;&nbsp;.addChild(new Comment("Sound Card 
Configuration"))<BR>&nbsp;&nbsp;&nbsp;.addChild(new 
Element("sound")<BR>&nbsp;&nbsp;&nbsp;&nbsp;.addChild(new Comment("Sound Blaster 
Card"))<BR>&nbsp;&nbsp;&nbsp;&nbsp;.addChild(new 
Element("card")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.addChild(new 
Element("name")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.setContent("Sound 
Blaster Platinum"))));<BR>&nbsp;&nbsp;XMLOutputter fmt = new 
XMLOutputter();<BR>&nbsp;&nbsp;fmt.output(doc, 
out);<BR>&nbsp;}<BR>&nbsp;<BR>&nbsp;public void domDocument(File file, 
OutputStream out)<BR>&nbsp;&nbsp;throws IOException, 
JDOMException{<BR>&nbsp;<BR>&nbsp;&nbsp;DOMBuilder builder = new 
DOMBuilder(true);<BR>&nbsp;&nbsp;Document doc = 
builder.build(file);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;XMLOutputter fmt = new 
XMLOutputter();<BR>&nbsp;&nbsp;fmt.output(doc, out);<BR>&nbsp;}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;public void saxDocument(File file, 
OutputStream out)<BR>&nbsp;&nbsp;throws IOException, 
JDOMException{<BR>&nbsp;<BR>&nbsp;&nbsp;SAXBuilder builder = new 
SAXBuilder(true);<BR>&nbsp;&nbsp;Document doc = 
builder.build(file);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;XMLOutputter fmt = new 
XMLOutputter();<BR>&nbsp;&nbsp;fmt.output(doc, out);<BR>&nbsp;}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;public static void main(String[] 
args){<BR>&nbsp;&nbsp;if(args.length != 
1){<BR>&nbsp;&nbsp;&nbsp;System.out.println("Usage: JDOMTest (filename to 
parse)");<BR>&nbsp;&nbsp;&nbsp;System.exit(-1);<BR>&nbsp;&nbsp;}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;try{<BR>&nbsp;&nbsp;JDOMTest test = new 
JDOMTest();<BR>&nbsp;&nbsp;System.out.println("\n\n----------------------------------------------");<BR>&nbsp;&nbsp;System.out.println("Testing 
creating Document from scratch 
...");<BR>&nbsp;&nbsp;System.out.println("----------------------------------------------\n\n");<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;test.newDocument(System.out);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial 
size=2>&nbsp;&nbsp;System.out.println("\n\n----------------------------------------------");<BR>&nbsp;&nbsp;System.out.println("Testing 
reading Document using DOM 
...");<BR>&nbsp;&nbsp;System.out.println("----------------------------------------------\n\n");<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;test.domDocument(new 
File(args[0]), System.out);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial 
size=2>&nbsp;&nbsp;System.out.println("\n\n----------------------------------------------");<BR>&nbsp;&nbsp;System.out.println("Testing 
reading Document using SAX 
...");<BR>&nbsp;&nbsp;System.out.println("----------------------------------------------\n\n");</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;test.saxDocument(new File(args[0]), 
System.out);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial 
size=2>&nbsp;&nbsp;System.out.println("\n\n----------------------------------------------");<BR>&nbsp;&nbsp;System.out.println("Tests 
complete. Successful build in place.");</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;} catch (Exception 
e){<BR>&nbsp;&nbsp;&nbsp;e.printStackTrace();<BR>&nbsp;&nbsp;&nbsp;if(e 
instanceof 
JDOMException){<BR>&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(((JDOMException)e) 
.getRootCause() 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.getMessage());<BR>&nbsp;&nbsp;&nbsp;} 
else 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(e.getMessage());<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}<BR>&nbsp;}<BR>}</FONT></DIV>
<DIV><FONT face=Arial size=2>[/code]</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Multispex Designs<BR>Rep.: Shant Adam<BR>Tel.: 
(514) 827-4840<BR><A 
href="mailto:adams@multispex.com">adams@multispex.com</A><BR><A 
href="http://www.multispex.com">http://www.multispex.com</A><BR>---<BR>Visual 
technology service provider.<BR>Fournisseur de service de technologie 
visuel.<BR>---<BR>Copyright 1998-2002©<BR>Multispex 
Designs®</FONT></DIV></BODY></HTML>