The problem is to parse the HTML table into the 2D array.
The parser should handle rowspans, collspans, nested tables and so on. That means, everything that suites HTML standard. The thing is that the tables I need to parse are automatically generated by another program, so they are rather complex and excessive.
To date I found a solutions on php (JS_Extractor http://jacksleight.com/old/blog/2008...able-extractor), and Java (http://simbot.wordpress.com/2006/09/...-table-parser/), but is seems like they don't suite my requirements.
In addition, I found JWebUnit and HTTPUnit, but I didn't found how to use them for my purposes (and I am not even sure that it is possible).
I'll be happy for any help, as I can't believe this problem was not solved yet!
Thanks in advance!
1. The program must be written in Java;
2. If the table contains spans, the value of the spanned cell should be put only ones in array in the left up corner of cells of this array, the other cells, correspondent to the spanned cell in HTML table should be nulled (maybe it is hard to understand, see examples below).
So, the JS_Extractor is not valid, as it is written on PHP and doesn't handle inherited tables. Java HTML Table parser Simbiosis doesn't handle even spans.
Today I tried to use HTTPUnit, but the results are disappointing too. The simple tables are parsed correctly, but the complex one not.
Here you can see what I meant in the requirement number 2. "1" from the fist span and "1" from the second areas are put in the left upper corner of the spanned area, while the rest cells in this area are null.
The result, given by HTTPUnit:
As you can see, even if we throw the requirement 2 away, we have an error in the third row here.
And this is a rather simple example, without inherited tables, with them it is terribly wrong.