This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Couldn't convert HTML to XML file due to Java I/O issue

Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am having difficulty saving a complete ABC.html file (from certain website. e.g. in time so that it could be used to convert to ABC.xml format (a combination of Saxon and TagSoup parser). This issue may have been due to the premature closing of ABC.html prior to reading is completed by XML conversion tools(light_html2xml or Saxon with TagSoup).

Note that ABC.html has been created successfully. However, the question is at what stage that it has been completely written and when was it being read by the conversion tool?

There is no problem with either of the conversion tools and I have used them extensively including in the former program. More importantly, this issue was posted to many different forums (,,, but this symptom has indicated that it is an I/O issue as opposed to anything else.

This issue has plagued me for months where I thought the problem was from the XML conversion tool (light_html2xml or Saxon with TagSoup).

I have exhausted every effort but could not find a solution still.

The above programs are running on JDK 1.6.0_06, Netbeans 6.1, JDom 1.1, Saxon 6.5.5, TagSoup 1.2 on Windows XP.

This question has also been posted on
Any assistance would be much appreciated.

Many thanks,

Posts: 43016
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should flush and close any stream that's related to writing a file, before you start reading from that file.
Jack Bush
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf,

You were spot on about this issue!

The reading of ABC.html is now working after having added the flush and closing upstream.

Thank you very much,

The City calls upon her steadfast protectors. Now for a tiny ad:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic