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/