<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2314.1000" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT color=#000080 face=Verdana size=2>Hi </FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000080 face=Verdana size=2>When I am replacing Builder with
DOMBuilder(page no 354 - Java and XML Oreilly -as per errata javaxml.800), I am
facing one probem during compilation and the probem is described
below:</FONT></DIV>
<DIV><FONT color=#000080 face=Verdana size=2></FONT> </DIV>
<DIV><FONT color=#000080 face=Verdana size=2></FONT> </DIV>
<DIV><FONT color=#000080 face=Verdana size=2>Page No: 354 / Java and Xml by
Oreilly</FONT></DIV>
<DIV><FONT color=#000080 face=Verdana size=2></FONT> </DIV>
<DIV><FONT color=#000080 face=Verdana size=2>E:\xml_test\jdom\src>javac
XmlRpcConfiguration.java<BR>XmlRpcConfiguration.java:140: Incompatible type for
method. Explicit cast needed to convert java.io<BR>Stream to
org.w3c.dom.Document.<BR>
Document doc =
builder.build(in);<BR>
^<BR>1 error</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000080 face=Verdana size=2>The same problem occured even for
DOMTest probem,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000080 face=Verdana size=2>The source code DOMTest.java is
given below:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000080 face=Verdana size=2><BR>import java.io.File;<BR>import
java.io.IOException;</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000080 face=Verdana size=2>import org.jdom.Document;<BR>import
org.jdom.Element;<BR>import org.jdom.JDOMException;<BR>import
org.jdom.input.DOMBuilder;<BR><A href="file://import">file://import</A>
org.jdom.input.Builder; -</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000080 face=Verdana size=2>public class DOMTest {</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000080 face=Verdana size=2> public static void
main(String[] args) {</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000080 face=Verdana size=2> if (args.length
!=1 )<BR> {<BR>
System.out.println("Usage : java DOMTest [filename to parse]
");<BR> return;<BR>
}</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000080 face=Verdana size=2>
try<BR> {<BR> DOMBuilder builder
= new
DOMBuilder("org.jdom.adapters.OracleV2DOmAdapter");<BR>
Document doc = builder.build(new File(args[0]));</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000080 face=Verdana size=2>
System.out.println("Document Successfully Read");<BR>
}<BR> catch (JDOMException
e)<BR> {<BR>
e.printStackTrace();<BR> }</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000080 face=Verdana size=2> }<BR>}</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000080 face=Verdana size=2>After implementing the corrections,
as specified javaxml.800,ie:<BR>removing the import org.jdom.input.Builder and
replacing the Builder with DOMBuilder, The following error is occuring after
compiling: </FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000080 face=Verdana size=2>E:\xml_test\jdom\src>javac
DOMTest.java<BR>DOMTest.java:26: Incompatible type for method. Explicit cast
needed to convert java.io.File to
org.<BR>m.Document.<BR> Document doc =
builder.build(new
File(args[0]));<BR>
^<BR>1 error</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000080 face=Verdana size=2>Please send me the suggestions to
<A href="mailto:harish.kumar@patni.com">harish.kumar@patni.com</A></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000080 face=Verdana size=2>Regards</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000080 face=Verdana size=2>Harish<BR></FONT></DIV>
<DIV> </DIV>
<DIV> </DIV></BODY></HTML>