Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2005

Tip: Looking for answers? Try searching our database.

Java based HTML parser that outputs a formatted text string?

Thread view: 
Harry Bosch - 03 Aug 2005 18:33 GMT
Sorry about the subject, I couldn't think of a good one liner.

Does anyone know of an java based html parser that can output its
results to a formatted string (using spaces and such to handle the
layout)?

I am looking for something that can take an HTML table, such as:

<table border="1">
 <tr>
  <th>Cost</th>
  <th>Total</th>
 </tr>
 <tr>
   <td>10</td>
   <td>100</td>
 </tr>
 <tr>
   <td>20</td>
   <td>200</td>
 </tr>
 <tr>
   <td>30</td>
   <td>300</td>
 </tr>
</table>

And output it into a string that would look like this when displayed on
a console, text file, or whatever output device:

+--------------+
| Cost | Total |
|------+-------|
|  10  |  100  |
|------+-------|
|  20  |  200  |
|------+-------|
|  30  |  300  |
+--------------+

I guess I am looking for the functionality of something like Links (the
console HTML browser).  I want to transform (without using XSLT and
complex transformations) a simple (simple being the key word here) html
file into a formatted text file.  And, I really don't feel like
resorting to JNI to fire off Links.  I don't need CSS or anything like
that.  

Thanks in advance,

Harry Bosch
Thomas Hawtin - 03 Aug 2005 19:05 GMT
> I am looking for something that can take an HTML table, such as:
>
[quoted text clipped - 12 lines]
> |  30  |  300  |
> +--------------+

IIRC, Apache FOP can generate monospaced text from XSL FO. But it wasn't
very good and you need to transform your HTML a bit.

> file into a formatted text file.  And, I really don't feel like
> resorting to JNI to fire off Links.  I don't need CSS or anything like

Or Process[Builder]?

Signature

Unemployed English Java programmer
http://jroller.com/page/tackline/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.