<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:12pt"><DIV><SPAN lang=EN-AU>Hi Everyone,</SPAN></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: Courier New, courier, monaco, monospace, sans-serif">
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: Courier New, courier, monaco, monospace, sans-serif">
<DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU>&nbsp;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU>I have added the additional I/O statements in the finally clause as follows but the problem still persisted:</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU>&nbsp;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><U>readData() </U></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">// reading data (html) from the webpage and save it in html format.</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">try {</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN>&nbsp;&nbsp;&nbsp; </SPAN>….</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">}</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">catch { …. }</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">finally {</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>System.out.flush();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>isInHtml.close();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>disInHtml.close();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>fosOutHtml.flush();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>fosOutHtml.getFD().sync();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>fosOutHtml.close();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU>}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU>&nbsp;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU>// convert the html webpage format to xml format</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">try {</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN>&nbsp;&nbsp;&nbsp; </SPAN>….</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">}</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">catch { …. }</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">finally {</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU><SPAN>&nbsp; </SPAN><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>System.out.flush();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU><SPAN>&nbsp; </SPAN><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>fwOutXml.flush();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU><SPAN>&nbsp; </SPAN><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>fwOutXml.close();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU><SPAN>&nbsp; </SPAN><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>pwOutXml.flush();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU><SPAN>&nbsp; </SPAN><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>pwOutXml.close();</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU>}</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU>&nbsp;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU>Below is a short listing of the new XML file:</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU>&nbsp;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <FONT color=#0000ff><SPAN class=m1>&lt;?</SPAN><SPAN class=pi1>xml version="1.0" encoding="iso-8859-1" </SPAN><SPAN class=m1>?&gt;</SPAN></FONT> </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><A rel=nofollow><B><SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'">-</SPAN></B></A> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>html</FONT></SPAN><FONT color=#0000ff><SPAN class=m1>&gt;</SPAN></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><A rel=nofollow><B><SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'">-</SPAN></B></A> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>head</FONT></SPAN><FONT color=#0000ff><SPAN class=m1>&gt;</SPAN></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>meta</FONT></SPAN> <SPAN class=t1><FONT color=#990000>http-equiv</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>Content-Type</B><SPAN class=m1><FONT color=#0000ff>"</FONT></SPAN><SPAN class=t1><FONT color=#990000> content</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>text/html; charset=UTF-8</B><SPAN class=m1><FONT color=#0000ff>" /&gt;</FONT></SPAN> </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>meta</FONT></SPAN> <SPAN class=t1><FONT color=#990000>name</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>keywords</B><SPAN class=m1><FONT color=#0000ff>"</FONT></SPAN><SPAN class=t1><FONT color=#990000> content</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN></SPAN><SPAN class=m1><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><FONT color=#0000ff>California</FONT></SPAN></SPAN><B><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">, cities, towns, villages, list, zipcodes, postal codes, united states, ca</SPAN></B><SPAN class=m1><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><FONT
 color=#0000ff>" /&gt;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>meta</FONT></SPAN> <SPAN class=t1><FONT color=#990000>name</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>description</B><SPAN class=m1><FONT color=#0000ff>"</FONT></SPAN><SPAN class=t1><FONT color=#990000> content</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>Cities, towns and suburbs in </B></SPAN><B><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">California</SPAN></B><B><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">, </SPAN></B><B><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">United States</SPAN></B><B><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> (CA) starting with
 A</SPAN></B><SPAN class=m1><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><FONT color=#0000ff>" /&gt;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>title</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>&gt;</FONT></SPAN><SPAN class=tx1><STRONG>Cities and Towns in </STRONG></SPAN></SPAN><STRONG><SPAN class=tx1><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">California</SPAN></SPAN><SPAN class=tx1><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> starting with A – ABC Company</SPAN></SPAN></STRONG><SPAN class=m1><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><FONT color=#0000ff>&lt;/</FONT></SPAN></SPAN><SPAN class=t1><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><FONT color=#990000>title</FONT></SPAN></SPAN><SPAN class=m1><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY:
 Verdana"><FONT color=#0000ff>&gt;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>link</FONT></SPAN> <SPAN class=t1><FONT color=#990000>rel</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>stylesheet</B><SPAN class=m1><FONT color=#0000ff>"</FONT></SPAN><SPAN class=t1><FONT color=#990000> href</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>http://www.abc.com/style.css</B><SPAN class=m1><FONT color=#0000ff>"</FONT></SPAN><SPAN class=t1><FONT color=#990000> type</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>text/css</B><SPAN class=m1><FONT color=#0000ff>"</FONT></SPAN><SPAN class=t1><FONT color=#990000> media</FONT></SPAN><SPAN class=m1><FONT
 color=#0000ff>="</FONT></SPAN><B>screen</B><SPAN class=m1><FONT color=#0000ff>" /&gt;</FONT></SPAN> </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <SPAN class=m1><FONT color=#0000ff>&lt;/</FONT></SPAN><SPAN class=t1><FONT color=#990000>head</FONT></SPAN><FONT color=#0000ff><SPAN class=m1>&gt;</SPAN></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><A rel=nofollow><B><SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'">-</SPAN></B></A> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>body</FONT></SPAN><FONT color=#0000ff><SPAN class=m1>&gt;</SPAN></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>a</FONT></SPAN> <SPAN class=t1><FONT color=#990000>name</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>top</B><SPAN class=m1><FONT color=#0000ff>" /&gt;</FONT></SPAN> </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><A rel=nofollow><B><SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'">-</SPAN></B></A> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>div id</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>container</B><FONT color=#0000ff><SPAN class=m1>"&gt;</SPAN></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><A rel=nofollow><B><SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'">-</SPAN></B></A> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>div id</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>header</B><FONT color=#0000ff><SPAN class=m1>"&gt;</SPAN></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>div</FONT></SPAN> <SPAN class=t1><FONT color=#990000>id</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>postmark</B><SPAN class=m1><FONT color=#0000ff>" /&gt;</FONT></SPAN> </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><A rel=nofollow><B><SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'">-</SPAN></B></A> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>a href</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>http://www.abc.com/</B><SPAN class=m1><FONT color=#0000ff>"</FONT></SPAN><SPAN class=t1><FONT color=#990000> class</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>imglink</B><FONT color=#0000ff><SPAN class=m1>"&gt;</SPAN></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>img</FONT></SPAN> <SPAN class=t1><FONT color=#990000>id</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>logoimg</B><SPAN class=m1><FONT color=#0000ff>"</FONT></SPAN><SPAN class=t1><FONT color=#990000> src</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>http://www.abc.com/images/zipcodes.gif</B><SPAN class=m1><FONT color=#0000ff>"</FONT></SPAN><SPAN class=t1><FONT color=#990000> width</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>192</B><SPAN class=m1><FONT color=#0000ff>"</FONT></SPAN><SPAN class=t1><FONT color=#990000> height</FONT></SPAN><SPAN class=m1><FONT
 color=#0000ff>="</FONT></SPAN><B>33</B><SPAN class=m1><FONT color=#0000ff>"</FONT></SPAN><SPAN class=t1><FONT color=#990000> alt</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>Zipcodes America Logo</B><SPAN class=m1><FONT color=#0000ff>" /&gt;</FONT></SPAN> </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <SPAN class=m1><FONT color=#0000ff>&lt;/</FONT></SPAN><SPAN class=t1><FONT color=#990000>a</FONT></SPAN><FONT color=#0000ff><SPAN class=m1>&gt;</SPAN></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>hr</FONT></SPAN> <SPAN class=m1><FONT color=#0000ff>/&gt;</FONT></SPAN> </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <SPAN class=m1><FONT color=#0000ff>&lt;/</FONT></SPAN><SPAN class=t1><FONT color=#990000>div</FONT></SPAN><FONT color=#0000ff><SPAN class=m1>&gt;</SPAN></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><A rel=nofollow><B><SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'">-</SPAN></B></A> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>div id</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>nav</B><FONT color=#0000ff><SPAN class=m1>"&gt;</SPAN></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><A rel=nofollow><B><SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'">-</SPAN></B></A> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>ul</FONT></SPAN><FONT color=#0000ff><SPAN class=m1>&gt;</SPAN></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><A rel=nofollow><B><SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'">-</SPAN></B></A> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>li</FONT></SPAN><FONT color=#0000ff><SPAN class=m1>&gt;</SPAN></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>a href</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>http://www.abc.com/</B><SPAN class=m1><FONT color=#0000ff>"</FONT></SPAN><SPAN class=t1><FONT color=#990000> title</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>Home Page</B><SPAN class=m1><FONT color=#0000ff>"&gt;</FONT></SPAN><SPAN class=tx1><STRONG>Home</STRONG></SPAN><SPAN class=m1><FONT color=#0000ff>&lt;/</FONT></SPAN><SPAN class=t1><FONT color=#990000>a</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>&gt;</FONT></SPAN> </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <SPAN class=m1><FONT color=#0000ff>&lt;/</FONT></SPAN><SPAN class=t1><FONT color=#990000>li</FONT></SPAN><FONT color=#0000ff><SPAN class=m1>&gt;</SPAN></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><A rel=nofollow><B><SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'">-</SPAN></B></A> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>li</FONT></SPAN><FONT color=#0000ff><SPAN class=m1>&gt;</SPAN></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>strong</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>&gt;</FONT></SPAN><SPAN class=tx1><STRONG>Search</STRONG></SPAN><SPAN class=m1><FONT color=#0000ff>&lt;/</FONT></SPAN><SPAN class=t1><FONT color=#990000>strong</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>&gt;</FONT></SPAN> </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <STRONG><SPAN class=tx1>(zipcode or suburb) </SPAN></STRONG></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><A rel=nofollow><SPAN style="COLOR: red; FONT-FAMILY: 'Courier New'"><STRONG>-</STRONG></SPAN></A> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>div class</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>hide</B><FONT color=#0000ff><SPAN class=m1>"&gt;</SPAN></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>form</FONT></SPAN> <SPAN class=t1><FONT color=#990000>method</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>post</B><SPAN class=m1><FONT color=#0000ff>"</FONT></SPAN><SPAN class=t1><FONT color=#990000> action</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>http://www.abc.com/search</B><SPAN class=m1><FONT color=#0000ff>" /&gt;</FONT></SPAN> <SPAN>&nbsp;&nbsp;&nbsp;</SPAN><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>// line 23</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <SPAN class=m1><FONT color=#0000ff>&lt;/</FONT></SPAN><SPAN class=t1><FONT color=#990000>div</FONT></SPAN><FONT color=#0000ff><SPAN class=m1>&gt;</SPAN></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>input</FONT></SPAN> <SPAN class=t1><FONT color=#990000>type</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>text</B><SPAN class=m1><FONT color=#0000ff>"</FONT></SPAN><SPAN class=t1><FONT color=#990000> name</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>q</B><SPAN class=m1><FONT color=#0000ff>"</FONT></SPAN><SPAN class=t1><FONT color=#990000> class</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>searchbox</B><SPAN class=m1><FONT color=#0000ff>"</FONT></SPAN><SPAN class=t1><FONT color=#990000> alt</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>Search query</B><SPAN
 class=m1><FONT color=#0000ff>" /&gt;</FONT></SPAN> </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>br</FONT></SPAN> <SPAN class=m1><FONT color=#0000ff>/&gt;</FONT></SPAN> </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>input</FONT></SPAN> <SPAN class=t1><FONT color=#990000>type</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>submit</B><SPAN class=m1><FONT color=#0000ff>"</FONT></SPAN><SPAN class=t1><FONT color=#990000> value</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>find!</B><SPAN class=m1><FONT color=#0000ff>"</FONT></SPAN><SPAN class=t1><FONT color=#990000> class</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>searchbutton</B><SPAN class=m1><FONT color=#0000ff>"</FONT></SPAN><SPAN class=t1><FONT color=#990000> alt</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>Perform
 search</B><SPAN class=m1><FONT color=#0000ff>" /&gt;</FONT></SPAN> </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <SPAN class=m1><FONT color=#0000ff>&lt;&lt;</FONT></SPAN><SPAN class=t1><FONT color=#990000>div</FONT></SPAN> <SPAN class=t1><FONT color=#990000>class</FONT></SPAN><SPAN class=m1><FONT color=#0000ff>="</FONT></SPAN><B>hide</B><SPAN class=m1><FONT color=#0000ff>" /&gt;</FONT></SPAN> </SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN class=b1><SPAN style="FONT-SIZE: 10pt"><STRONG><FONT face="Courier New" color=#ff0000>&nbsp;</FONT></STRONG></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> <SPAN class=m1><FONT color=#0000ff>&lt;/</FONT></SPAN><SPAN class=t1><FONT color=#990000>li</FONT></SPAN><FONT color=#0000ff><SPAN class=m1>&gt;</SPAN></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><B><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">…</SPAN></B><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU>&nbsp;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU>What I find it interesting is that it is possible to parse the above XML file with the same parseData() from another class without any problem. As a result, I have come to the following conclusion so far:</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU>( i ) There is some file locking that is prevent saxBuilder from parsing the XML file at the time.</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU>( ii ) The light_html2xml does not appears to have correctly converted over the orginal Html to Xml but some how it has been picked up by the parser in the same class, but not by the same parser from another class.</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU>( iii ) I would like to use another conversion tool such as Tagsoup in place of light_html2xml to determine where the cause of this issue is coming from. As a result, would anyone be able to assist me coming up with a few lines of conversion statements using Tagsoup since I am not familiar with using this tool?</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU>( iv ) light_html2xml is good as it strip out all namespace, DTD, Entity Resolver, etc and only return what I need. JTidy does correct conversion but include namespace, DTD, Entity Resolver which makes parsing difficulty.</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU>&nbsp;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU>Many thanks again,</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU>&nbsp;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-AU>Jack </SPAN><CODE><SPAN lang=EN-AU style="BORDER-RIGHT: #eeeeee 1pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #eeeeee 1pt solid; PADDING-LEFT: 0cm; FONT-SIZE: 9pt; BACKGROUND: #eeeeee; PADDING-BOTTOM: 0cm; BORDER-LEFT: #eeeeee 1pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: #eeeeee 1pt solid"><SPAN><FONT face=Courier color=#666666>&nbsp;</FONT></SPAN></SPAN></CODE><SPAN lang=EN-AU><SPAN>&nbsp;</SPAN></SPAN></P></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: Courier New, courier, monaco, monospace, sans-serif"><BR>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><FONT face=Tahoma size=2>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Sheila M. Morrissey &lt;Sheila.Morrissey@portico.org&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Jack Bush &lt;netbeansfan@yahoo..com.au&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Wednesday, 29 October, 2008 12:52:06 AM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE: [xml-dev] Cannot close an XML file used for parsing<BR></FONT><BR>
<STYLE>
<!--

_filtered {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;}

p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;text-decoration:underline;}
span.EmailStyle17
        {font-family:Arial;color:navy;}
_filtered {margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {}
-->
</STYLE>

<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Jack – did you try </SPAN></FONT><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">fosOutHtml.getFD().sync() <FONT color=#333399><SPAN style="COLOR: #333399">after the flush</SPAN></FONT>?</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=#333399 size=2><SPAN style="FONT-SIZE: 10pt; COLOR: #333399; FONT-FAMILY: Arial">Regards</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=#333399 size=2><SPAN style="FONT-SIZE: 10pt; COLOR: #333399; FONT-FAMILY: Arial">Sheila</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">&nbsp;</SPAN></FONT></P>
<DIV>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> Jack Bush [mailto:netbeansfan@yahoo.com.au] <BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Tuesday, October 28, 2008 8:41 AM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Robert Koberg<BR><B><SPAN style="FONT-WEIGHT: bold">Cc:</SPAN></B> xml-dev@lists.xml.org<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [xml-dev] Cannot close an XML file used for parsing</SPAN></FONT></P></DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;</SPAN></FONT></P>
<DIV>
<DIV>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">Hi Robert,</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">&nbsp;</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">Thanks for responding to this post.</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">&nbsp;</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">I have added your suggestion but the issue still persist. Nevertheless, I do believe that this is caused by the new XML file not having been closed properly.</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">&nbsp;</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">There is no problem with&nbsp;<A href="http://sourceforge.net/projects/light-html2xml" target=_blank rel=nofollow>light-html2xml</A>&nbsp;method which has worked in the past.</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">&nbsp;</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">Any more suggestion to try out?</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">&nbsp;</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">Thanks,</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">&nbsp;</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">Jack</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Courier New" size=3><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Courier New'">&nbsp;</SPAN></FONT></P>
<DIV>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">
<HR align=center width="100%" SIZE=1>
</SPAN></FONT></DIV>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><B><FONT face=Tahoma size=2><SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> Robert Koberg &lt;rob@koberg..com&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Jack Bush &lt;netbeansfan@yahoo.com.au&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">Cc:</SPAN></B> xml-dev@lists.xml.org<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Tuesday, 28 October, 2008 9:42:21 AM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [xml-dev] Cannot close an XML file used for parsing<BR></SPAN></FONT><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><BR><BR>close the stream or reader in a finally block to avoid leaving it open&nbsp; <BR>if an error occurs.<BR><BR>try{<BR>}catch(....){<BR>}finally {<BR>}<BR><BR>On Oct 27, 2008, at 6:03 PM, Jack Bush
 wrote:<BR><BR>&gt; Hi All,<BR>&gt;<BR>&gt; I appears to have difficulty closing (possibly flushing it first) an&nbsp; <BR>&gt; XML file that was subsequently being parsed without success. The&nbsp; <BR>&gt; error generated is:<BR>&gt;<BR>&gt; org.jdom.input.JDOMParseException: Error on line 23: The element&nbsp; <BR>&gt; type "form" must be terminated by the matching end-tag "&lt;/form&gt;".<BR>&gt;<BR>&gt; Below is the code snippets of readData() to retrieve (HTML) data&nbsp; <BR>&gt; from a website, save it to a file, then convert to XML format before&nbsp; <BR>&gt; returning the new filename:<BR>&gt; public String readData() {<BR>&gt;<BR>&gt;&nbsp; &nbsp; try {<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; URL url&nbsp; = new URL("<A href="http://www.abc.com/" target=_blank rel=nofollow>http://www.abc.com</A>");<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; URLConnection connection = url.openConnection();<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; InputStream
 isInHtml = url.openStream();&nbsp; // throws an&nbsp; <BR>&gt; IOException<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; disInHtml = new DataInputStream(new&nbsp; <BR>&gt; BufferedInputStream(isInHtml));<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.flush();<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FileOutputStream fosOutHtml = null;<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fosOutHtml = new FileOutputStream("C:\\Temp\\ABC.html");<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int oneChar, count=0;<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while ((oneChar=disInHtml.read()) != -1)<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fosOutHtml.write(oneChar);<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; isInHtml.close();<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; disInHtml.close();<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fosOutHtml.flush();&nbsp; &nbsp; // optional<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fosOutHtml..close();<BR>&gt;&nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; .....<BR>&gt;&nbsp; &nbsp; }<BR>&gt;<BR>&gt;&nbsp; &nbsp; try {<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; File fileInHtml = new File("C:\\Temp\\ABC.html");<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FileReader frInHtml = new FileReader(fileInHtml);<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BufferedReader brInHtml = new BufferedReader(frInHtml);<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String string = "";<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (brInHtml.ready())<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; string += brInHtml.readLine() + "\n";<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fwOutXml&nbsp; = new FileWriter("C:\\Temp\\ABC.xml");<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pwOutXml&nbsp; = new PrintWriter(fwOutXml);<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; light_html2xml html2xml = new light_html2xml();<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pwOutXml.print(html2xml.Html2Xml(string));<BR>&gt;&nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; system.out.flush()&nbsp; &nbsp; // optional<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fwOutXml.flush();&nbsp; &nbsp; &nbsp; // optional<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fwOutXml.close();<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pwOutXml.flush();&nbsp; &nbsp; &nbsp; // optional<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pwOutXml.close();<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return fileInHtml.getAbsolutePath();<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ....<BR>&gt;&nbsp; &nbsp; }<BR>&gt; }<BR>&gt;<BR>&gt; // parseData reads the XML file using the name returned by readData()<BR>&gt; public void parseData(String XMLFilename)<BR>&gt; {<BR>&gt;&nbsp; &nbsp; try<BR>&gt;&nbsp; &nbsp; {<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; FileReader frInXml = new FileReader(FileName);<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; BufferedReader brInXml = new BufferedReader(frInXml);<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; SAXBuilder saxBuilder = new&nbsp; <BR>&gt;
 SAXBuilder("org.apache.xerces.parsers.SAXParser"); //&nbsp; <BR>&gt; JDOMParseException generated.<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; ....<BR>&gt; }<BR>&gt; These codes would worked when they were in a single method but I&nbsp; <BR>&gt; have since placed some structure around them using a number methods.<BR>&gt;<BR>&gt; This issue has risen in th past where I have been able to close the&nbsp; <BR>&gt; XML file prior to reading them again. However, I don't have a&nbsp; <BR>&gt; solution for it this time round.<BR>&gt;<BR>&gt; I am running JDK 1.6.0_10, Netbeans 6.1, JDOM 1.1 on Windows XP&nbsp; <BR>&gt; platform.<BR>&gt;<BR>&gt; Any assistance would be appreciated..<BR>&gt;<BR>&gt; Many thanks,<BR>&gt;<BR>&gt; Jack<BR>&gt;<BR></SPAN></FONT></P></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV></div><br>



      <hr size=1> Search 1000's of available singles in your area at the new Yahoo!7 Dating.  
<a href="http://au.rd.yahoo.com/dating/mail/tagline1/*http://au.dating.yahoo.com/?cid=53151&pid=1011">Get Started</a>.</body></html>